diff options
author | William Jon McCann <mccann@jhu.edu> | 2007-02-21 11:31:09 -0500 |
---|---|---|
committer | William Jon McCann <mccann@jhu.edu> | 2007-02-21 11:31:09 -0500 |
commit | 0a8a82bf2701eadb3ef8c3ea927b1d61ea0f68ba (patch) | |
tree | a7c3c3eadb34a0797faceffb9d11526dfb65396f /src | |
parent | eb9361c9b0b05c3bd51de7325c3327db79431fc9 (diff) |
don't use null parameters
Diffstat (limited to 'src')
-rw-r--r-- | src/ck-session.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/ck-session.c b/src/ck-session.c index bfcde83..bc3c07b 100644 --- a/src/ck-session.c +++ b/src/ck-session.c @@ -929,21 +929,23 @@ ck_session_new_with_parameters (const char *ssid, "cookie", cookie, NULL); - for (i = 0; i < parameters->len; i++) { - GValue val_struct = { 0, }; - const char *prop_name; - GValue *prop_val; - - g_value_init (&val_struct, CK_TYPE_PARAMETER_STRUCT); - g_value_set_static_boxed (&val_struct, g_ptr_array_index (parameters, i)); - - dbus_g_type_struct_get (&val_struct, - 0, &prop_name, - 1, &prop_val, - G_MAXUINT); - - g_object_set_property (object, prop_name, prop_val); - g_value_unset (prop_val); + if (parameters != NULL) { + for (i = 0; i < parameters->len; i++) { + GValue val_struct = { 0, }; + const char *prop_name; + GValue *prop_val; + + g_value_init (&val_struct, CK_TYPE_PARAMETER_STRUCT); + g_value_set_static_boxed (&val_struct, g_ptr_array_index (parameters, i)); + + dbus_g_type_struct_get (&val_struct, + 0, &prop_name, + 1, &prop_val, + G_MAXUINT); + + g_object_set_property (object, prop_name, prop_val); + g_value_unset (prop_val); + } } res = register_session (CK_SESSION (object)); |