mirror of git://git.sysmocom.de/ofono
gprs/pri_set_apn: only call dbus function when msg is given
Otherwise dbus is trying to operate on a null-pointer resulting in an abort()
This commit is contained in:
parent
0db662bd6b
commit
6bd0e4ed9b
|
@ -950,10 +950,10 @@ static DBusMessage *pri_set_apn(struct pri_context *ctx, DBusConnection *conn,
|
|||
GKeyFile *settings = ctx->gprs->settings;
|
||||
|
||||
if (g_str_equal(apn, ctx->context.apn))
|
||||
return dbus_message_new_method_return(msg);
|
||||
return msg ? dbus_message_new_method_return(msg) : NULL;
|
||||
|
||||
if (is_valid_apn(apn) == FALSE)
|
||||
return __ofono_error_invalid_format(msg);
|
||||
return msg ? __ofono_error_invalid_format(msg) : NULL;
|
||||
|
||||
strcpy(ctx->context.apn, apn);
|
||||
|
||||
|
|
Loading…
Reference in New Issue