[gnome-bluetooth] settings: Avoid warnings when discovering new devices



commit a8f946d7589d544c2c8bb968a4ea11133333b84d
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Dec 7 10:33:29 2013 +0100

    settings: Avoid warnings when discovering new devices
    
    When device names aren't known yet, don't throw warnings.

 lib/bluetooth-settings-widget.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 2d3858c..7add20d 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -1150,6 +1150,15 @@ device_sort_func (gconstpointer a, gconstpointer b, gpointer data)
                goto out;
        }
 
+       if (name_a == NULL) {
+               ret = 1;
+               goto out;
+       }
+       if (name_b == NULL) {
+               ret = -1;
+               goto out;
+       }
+
        /* And all being equal, alphabetically */
        ret = g_utf8_collate (name_a, name_b);
 


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