advertising: parse_tx_power: reset value if iter is NULL
authorChristian Eggers <ceggers@arri.de>
Fri, 23 Sep 2022 14:58:11 +0000 (16:58 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:55 +0000 (14:55 +0530)
Set property to its default value (as done in all other methods listed
in parsers[]).

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/advertising.c

index a2ee13a..2fedc43 100644 (file)
@@ -1148,8 +1148,10 @@ static bool parse_tx_power(DBusMessageIter *iter,
        if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL))
                return true;
 
-       if (!iter)
+       if (!iter) {
+               client->tx_power = ADV_TX_POWER_NO_PREFERENCE;
                return false;
+       }
 
        if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INT16)
                return false;