From de40eb04030b2a53fc0bdaa7885abc260c7fedfe Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 9 Aug 2019 09:21:13 +0200 Subject: [PATCH] cli: reorder checks in nmc_setting_set_property() for modifier type No notable change in behavior, but makes more sense this way. --- clients/cli/settings.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 2446cb0856..91aaf28e38 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -549,12 +549,6 @@ nmc_setting_set_property (NMClient *client, if (!property_info->property_type->set_fcn) goto out_fail_read_only; - if ( NM_IN_SET (modifier, '+', '-') - && !value) { - /* nothing to do. */ - return TRUE; - } - if ( modifier == '-' && !property_info->property_type->set_supports_remove) { /* The property is a plain property. It does not support '-'. @@ -578,6 +572,13 @@ nmc_setting_set_property (NMClient *client, } } + if ( NM_IN_SET (modifier, '+', '-') + && ( !value + || !value[0])) { + /* nothing to do. */ + return TRUE; + } + g_object_freeze_notify (G_OBJECT (setting)); success = property_info->property_type->set_fcn (property_info, nmc_meta_environment,