Skip to content

Commit

Permalink
Avoid potential crash when dbus disappears
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed May 22, 2014
1 parent 69ee14d commit 1bf43cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/usb_moded-dbus.c
Expand Up @@ -309,6 +309,11 @@ static int usb_moded_dbus_signal(const char *signal_type, const char *content)
int result = 1;
DBusMessage* msg = 0;

if(!dbus_connection_sys)
{
log_err("Dbus system connection broken!\n");
goto EXIT;
}
// create a signal and check for errors
msg = dbus_message_new_signal(USB_MODE_OBJECT, USB_MODE_INTERFACE, signal_type );
if (NULL == msg)
Expand Down

0 comments on commit 1bf43cf

Please sign in to comment.