diff --git a/src/gprs.c b/src/gprs.c index 170f615e..b57cb4c9 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -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);