[gnome-settings-daemon] wacom: Bail create_fake() if the device isn't found



commit 4b23cab70186a6980549d1aa0209f0833367629c
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Dec 17 13:31:33 2011 +0000

    wacom: Bail create_fake() if the device isn't found

 plugins/wacom/gsd-wacom-device.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 2183a1c..8e35a3d 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -767,10 +767,13 @@ gsd_wacom_device_create_fake (GsdWacomDeviceType  type,
 	if (db == NULL)
 		db = libwacom_database_new ();
 
+	wacom_device = libwacom_new_from_name (db, name, NULL);
+	if (wacom_device == NULL)
+		return NULL;
+
 	priv = device->priv;
 	priv->type = type;
 	priv->tool_name = g_strdup (tool_name);
-	wacom_device = libwacom_new_from_name (db, name, NULL);
 	gsd_wacom_device_update_from_db (device, wacom_device, name);
 	libwacom_destroy (wacom_device);
 



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