diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-05-15 02:51:55 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-05-15 02:51:55 +0000 |
commit | 067f966a9b5ed7e8e28b5f2b483fb4650da9de88 (patch) | |
tree | d79454e3208e5a38a0061340ad30f16ac56b5cd3 /audio/control.c | |
parent | 865f1108806df04d4bc1b81d08756924e5d52d6a (diff) |
Fix default value handling when config file is not present
Diffstat (limited to 'audio/control.c')
-rw-r--r-- | audio/control.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/audio/control.c b/audio/control.c index 6bf05bef..4e8b948d 100644 --- a/audio/control.c +++ b/audio/control.c @@ -915,14 +915,15 @@ int avrcp_init(DBusConnection *conn, GKeyFile *config) if (avctp_server) return 0; - tmp = g_key_file_get_boolean(config, "General", "Master", - &err); - if (err) { - debug("audio.conf: %s", err->message); - g_error_free(err); - err = NULL; - } else - master = tmp; + if (config) { + tmp = g_key_file_get_boolean(config, "General", + "Master", &err); + if (err) { + debug("audio.conf: %s", err->message); + g_error_free(err); + } else + master = tmp; + } connection = dbus_connection_ref(conn); |