diff mbox series

[BlueZ,6/9] advertising: parse_tx_power: reset value if iter is NULL

Message ID 20220923102644.10526-1-ceggers@arri.de
State New
Headers show
Series properties_changed: check for NULL iterator | expand

Commit Message

Christian Eggers Sept. 23, 2022, 10:26 a.m. UTC
Set property to its default value (as done in all other methods listed
in parsers[]).
---
 src/advertising.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/advertising.c b/src/advertising.c
index 25df2297b3c1..f9748b1328bc 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1153,8 +1153,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;