[rhythmbox] shell: Avoid warnings when no sources match



commit e307181d79a2cf88d6ac148f1de82850b768a6d4
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Feb 7 19:58:35 2011 +0000

    shell: Avoid warnings when no sources match
    
    When the content of the paste buffer doesn't contain something
    that relates to an entry in the database, don't try to unref NULL.

 shell/rb-shell-clipboard.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/shell/rb-shell-clipboard.c b/shell/rb-shell-clipboard.c
index 20201e6..144dc4d 100644
--- a/shell/rb-shell-clipboard.c
+++ b/shell/rb-shell-clipboard.c
@@ -978,8 +978,10 @@ add_playlist_to_menu (GtkTreeModel *model,
 	g_object_get (page, "entry-type", &source_entry_type, NULL);
 	if (source_entry_type != entry_type) {
 		g_object_unref (page);
-		g_object_unref (entry_type);
-		g_object_unref (source_entry_type);
+		if (entry_type)
+			g_object_unref (entry_type);
+		if (source_entry_type)
+			g_object_unref (source_entry_type);
 		return FALSE;
 	}
 



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