[gnome-settings-daemon] wacom: check if the "last-stylus" property has been set before trying to get its associated settings



commit c11745733ba666cc48cfe2c8de5df4ff6815f673
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Tue Mar 20 10:30:22 2012 +0100

    wacom: check if the "last-stylus" property has been set before trying to get its associated settings (rhbz#799667)
    
    Release Team Approval: Matthias Clasen <matthias clasen gmail com>
    Release Team Approval: Andre Klapper <ak-47 gmx net>
    
    Signed-off-by: Richard Hughes <richard hughsie com>

 plugins/wacom/gsd-wacom-manager.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 6df9090..3bcd4de 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -362,6 +362,11 @@ apply_stylus_settings (GsdWacomDevice *device)
 	int threshold;
 
 	g_object_get (device, "last-stylus", &stylus, NULL);
+	if (stylus == NULL) {
+		g_warning ("Last stylus is not set");
+		return;
+	}
+
 	g_debug ("Applying setting for stylus '%s' on device '%s'",
 		 gsd_wacom_stylus_get_name (stylus),
 		 gsd_wacom_device_get_name (device));



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