[accounts-dialog] Add a few guards to the button handling functions



commit 8be12958478cef6516b81025dfcbc0a6a73de1ba
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jan 13 11:49:48 2010 +0000

    Add a few guards to the button handling functions

 src/um-crop-area.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/um-crop-area.c b/src/um-crop-area.c
index a10340c..ee92a5a 100644
--- a/src/um-crop-area.c
+++ b/src/um-crop-area.c
@@ -508,6 +508,9 @@ um_crop_area_button_press_event (GtkWidget      *widget,
 	GdkRectangle crop;
 	UmCropArea *area = UM_CROP_AREA (widget);
 
+	if (uarea->priv->browse_pixbuf == NULL)
+		return FALSE;
+
 	crop_to_widget (area, &crop);
 
 	area->priv->last_press_x = (event->x - area->priv->image.x) / area->priv->scale;
@@ -525,6 +528,9 @@ um_crop_area_button_release_event (GtkWidget      *widget,
 {
 	UmCropArea *area = UM_CROP_AREA (widget);
 
+	if (uarea->priv->browse_pixbuf == NULL)
+		return FALSE;
+
 	area->priv->last_press_x = -1;
 	area->priv->last_press_y = -1;
 	area->priv->active_region = OUTSIDE;



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