[gnome-bluetooth] Don't log a critical message when device address is NULL



commit dbc769f6dbfa6562dbe04218473eb33a0c23048d
Author: Daniele Forsi <daniele forsi it>
Date:   Fri Feb 4 11:38:22 2011 +0100

    Don't log a critical message when device address is NULL
    
    Reverse the order of the checks because a NULL value is valid for
    the "device" property but not valid for bluetooth_verify_address().
    Avoids printing the message:
    CRITICAL **: bluetooth_verify_address: assertion `bdaddr != NULL' failed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641488

 lib/bluetooth-chooser-button.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/bluetooth-chooser-button.c b/lib/bluetooth-chooser-button.c
index 1ee1201..533671e 100644
--- a/lib/bluetooth-chooser-button.c
+++ b/lib/bluetooth-chooser-button.c
@@ -283,8 +283,9 @@ bluetooth_chooser_button_set_property (GObject *object, guint property_id, const
 
 	switch (property_id)
 	case PROP_DEVICE: {
-		g_return_if_fail (bluetooth_verify_address (g_value_get_string (value)) || g_value_get_string (value) == NULL);
-		set_btdevname (button, g_value_get_string (value), NULL, NULL);
+		const char *str = g_value_get_string (value);
+		g_return_if_fail (str == NULL || bluetooth_verify_address (str));
+		set_btdevname (button, str, NULL, NULL);
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]