[epiphany] ephy-location-entry: handle gracefully first call
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [epiphany] ephy-location-entry: handle gracefully first call
- Date: Sun, 22 May 2011 12:14:08 +0000 (UTC)
commit 243e5e4985626aa44bfd0b74d17c478a4402e851
Author: Xan Lopez <xlopez igalia com>
Date:   Sun May 22 13:16:25 2011 +0200
    ephy-location-entry: handle gracefully first call
    
    The set_stock_id method is called initially with NULL to set things
    up.
 lib/widgets/ephy-location-entry.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index e321def..79c921f 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -1563,11 +1563,11 @@ ephy_location_entry_set_lock_stock (EphyLocationEntry *entry,
 	EphyLocationEntryPrivate *priv;
 
 	g_return_if_fail (EPHY_IS_LOCATION_ENTRY (entry));
-	g_return_if_fail (stock_id);
 
 	priv = entry->priv;
 
-	g_object_unref (priv->lock_gicon);
+	if (priv->lock_gicon)
+		g_object_unref (priv->lock_gicon);
 
 	/* At the moment we basically only show two kinds of
 	 * locks. Full/green for secure sites, Broken/red for sites
@@ -1575,7 +1575,7 @@ ephy_location_entry_set_lock_stock (EphyLocationEntry *entry,
 	 * their security infrastructure (broken cert, etc). For
 	 * everything else, nothing is shown.
 	 */
-	if (g_str_equal (stock_id, STOCK_LOCK_BROKEN))
+	if (!stock_id || g_str_equal (stock_id, STOCK_LOCK_BROKEN))
 		priv->lock_gicon = g_themed_icon_new_with_default_fallbacks ("changes-allow-symbolic");
 	else
 		priv->lock_gicon = g_themed_icon_new_with_default_fallbacks ("changes-prevent-symbolic");
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]