[rhythmbox] don't try to call impl_add_uri callbacks if they're NULL



commit 68c8ea368152fdb451c2971c64b22df84ca06205
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sat Aug 28 08:15:37 2010 +1000

    don't try to call impl_add_uri callbacks if they're NULL

 plugins/audioscrobbler/rb-lastfm-source.c |    8 ++++++--
 plugins/iradio/rb-iradio-source.c         |    8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/plugins/audioscrobbler/rb-lastfm-source.c b/plugins/audioscrobbler/rb-lastfm-source.c
index 4ad392c..1c4d71e 100644
--- a/plugins/audioscrobbler/rb-lastfm-source.c
+++ b/plugins/audioscrobbler/rb-lastfm-source.c
@@ -1419,8 +1419,12 @@ impl_add_uri (RBSource *source,
 		rb_lastfm_source_new_station (uri, name, RB_LASTFM_SOURCE (source));
 	}
 
-	callback (source, uri, data);
-	destroy_data (data);
+	if (callback != NULL) {
+		callback (source, uri, data);
+		if (destroy_data != NULL) {
+			destroy_data (data);
+		}
+	}
 	return ret;
 }
 
diff --git a/plugins/iradio/rb-iradio-source.c b/plugins/iradio/rb-iradio-source.c
index c73c585..f846f17 100644
--- a/plugins/iradio/rb-iradio-source.c
+++ b/plugins/iradio/rb-iradio-source.c
@@ -671,8 +671,12 @@ impl_add_uri (RBSource *source,
 		rb_iradio_source_add_station (RB_IRADIO_SOURCE (source),
 					      uri, title, genre);
 	}
-	callback (source, uri, data);
-	destroy_data (data);
+	if (callback != NULL) {
+		callback (source, uri, data);
+		if (destroy_data != NULL) {
+			destroy_data (data);
+		}
+	}
 	return TRUE;
 }
 



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