DBusMessage *reply = dbus_pending_call_steal_reply(call);
struct phonebook_data *s_data = user_data;
DBusError derr;
- const char *phonebook_entry;
+ const char *phonebook_entry = NULL;
DBG("");
dbus_pending_call_unref(s_data->call);
dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING,
&phonebook_entry, DBUS_TYPE_INVALID);
DBG("phonebook_entry:[%s]\n", phonebook_entry);
- }
- s_data->cb(phonebook_entry, strlen(phonebook_entry), 1, 0, TRUE,
- s_data->user_data);
+ if (phonebook_entry)
+ s_data->cb(phonebook_entry, strlen(phonebook_entry), 1, 0, TRUE,
+ s_data->user_data);
+ }
dbus_message_unref(reply);
}