summary refs log tree commit diff
path: root/libnm-core/nm-setting-connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-core/nm-setting-connection.c')
-rw-r--r--libnm-core/nm-setting-connection.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c
index e8d008e3..e4fb70c2 100644
--- a/libnm-core/nm-setting-connection.c
+++ b/libnm-core/nm-setting-connection.c
@@ -397,8 +397,7 @@ nm_setting_connection_add_permission (NMSettingConnection *setting,
 	GSList *iter;
 
 	g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), FALSE);
-	g_return_val_if_fail (ptype, FALSE);
-	g_return_val_if_fail (strlen (ptype) > 0, FALSE);
+	g_return_val_if_fail (ptype && ptype[0], FALSE);
 	g_return_val_if_fail (detail == NULL, FALSE);
 
 	/* Only "user" for now... */
@@ -470,9 +469,9 @@ nm_setting_connection_remove_permission_by_value (NMSettingConnection *setting,
 	GSList *iter;
 
 	g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), FALSE);
-	g_return_val_if_fail (ptype, FALSE);
-	g_return_val_if_fail (strlen (ptype) > 0, FALSE);
+	g_return_val_if_fail (ptype && ptype[0], FALSE);
 	g_return_val_if_fail (detail == NULL, FALSE);
+	g_return_val_if_fail (pitem != NULL, FALSE);
 
 	/* Only "user" for now... */
 	g_return_val_if_fail (strcmp (ptype, "user") == 0, FALSE);