diff options
author | zmike <michael.blumenkrantz@gmail.com> | 2016-08-12 13:35:11 -0400 |
---|---|---|
committer | zmike <michael.blumenkrantz@gmail.com> | 2016-08-12 13:35:11 -0400 |
commit | 6a402bdab4140b4ea0a3ea473a46143aa610ee25 (patch) | |
tree | 4870d8a631138b8f5ad2629c1db11e95dc510ba6 /src | |
parent | e8509d5935b79ef7387caeb4f7bc0377e265b366 (diff) |
add some connected checks in empdd methods
ensure mpd functions don't crash when null connection object is passed
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/empdd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/empdd.c b/src/bin/empdd.c index 6d4d5ef..1009598 100644 --- a/src/bin/empdd.c +++ b/src/bin/empdd.c | |||
@@ -1060,6 +1060,8 @@ _dbus_queue_list_cached_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, co | |||
1060 | const char *sig; | 1060 | const char *sig; |
1061 | Eldbus_Message *reply; | 1061 | Eldbus_Message *reply; |
1062 | 1062 | ||
1063 | if (!empd->connected) | ||
1064 | return eldbus_message_method_return_new(msg); | ||
1063 | if (!empd->current_queue) | 1065 | if (!empd->current_queue) |
1064 | return eldbus_message_method_return_new(msg); | 1066 | return eldbus_message_method_return_new(msg); |
1065 | 1067 | ||
@@ -1321,6 +1323,8 @@ _dbus_connect_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus | |||
1321 | static Eldbus_Message * | 1323 | static Eldbus_Message * |
1322 | _dbus_config_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg) | 1324 | _dbus_config_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg) |
1323 | { | 1325 | { |
1326 | if (!empd->connected) | ||
1327 | return eldbus_message_method_return_new(msg); | ||
1324 | cmd_append(EMPD_COMMAND_CONFIG)->data = eldbus_message_method_return_new(msg); | 1328 | cmd_append(EMPD_COMMAND_CONFIG)->data = eldbus_message_method_return_new(msg); |
1325 | mpd_async_send_command(empd->async, "config", NULL); | 1329 | mpd_async_send_command(empd->async, "config", NULL); |
1326 | fdh_update(); | 1330 | fdh_update(); |