summaryrefslogtreecommitdiffstats
path: root/src/ck-session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ck-session.c')
-rw-r--r--src/ck-session.c32
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));