[gnome-power-manager] trivial: don't crash in gpm_brightness_output_get_internal() if we have no backlight device



commit 0a79cb3c8586c8266119f89fd4c9d30eab286228
Author: Richard Hughes <richard hughsie com>
Date:   Tue Aug 31 13:37:32 2010 +0100

    trivial: don't crash in gpm_brightness_output_get_internal() if we have no backlight device

 src/gpm-brightness.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c
index 231a065..a7bcbaf 100644
--- a/src/gpm-brightness.c
+++ b/src/gpm-brightness.c
@@ -175,6 +175,9 @@ gpm_brightness_output_get_internal (GpmBrightness *brightness, RROutput output,
 
 	g_return_val_if_fail (GPM_IS_BRIGHTNESS (brightness), FALSE);
 
+	if (brightness->priv->backlight == None)
+		return FALSE;
+
 	if (XRRGetOutputProperty (brightness->priv->dpy, output, brightness->priv->backlight,
 				  0, 4, False, False, None,
 				  &actual_type, &actual_format,



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