[gnome-control-center] color: Do not crash if no sensors are plugged in



commit c7e48eb16a95a7a48fcd3d6a108b5b25add65eb6
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jan 8 14:53:18 2013 +0000

    color: Do not crash if no sensors are plugged in

 panels/color/cc-color-panel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c
index 84c1d82..eebf784 100644
--- a/panels/color/cc-color-panel.c
+++ b/panels/color/cc-color-panel.c
@@ -901,7 +901,7 @@ gcm_prefs_set_calibrate_button_sensitivity (CcColorPanel *prefs)
     {
 
     /* find whether we have hardware installed */
-    if (priv->sensors->len == 0)
+    if (priv->sensors == NULL || priv->sensors->len == 0)
       {
         /* TRANSLATORS: this is when the button is insensitive */
         tooltip = _("The measuring instrument is not detected. Please check it is turned on and correctly connected.");



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