[sushi/gnome-3-4] cover-art: make sure not to call result_list_get_size() on NULL
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi/gnome-3-4] cover-art: make sure not to call result_list_get_size() on NULL
- Date: Wed, 11 Apr 2012 17:13:46 +0000 (UTC)
commit c70ef2c2bc7252799c33e2d89faabb853f15a2ed
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Apr 11 13:10:45 2012 -0400
cover-art: make sure not to call result_list_get_size() on NULL
Just set results_len to zero in that case.
https://bugzilla.gnome.org/show_bug.cgi?id=669472
src/libsushi/sushi-cover-art.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libsushi/sushi-cover-art.c b/src/libsushi/sushi-cover-art.c
index 6e4fae4..0ab4259 100644
--- a/src/libsushi/sushi-cover-art.c
+++ b/src/libsushi/sushi-cover-art.c
@@ -216,7 +216,7 @@ fetch_uri_job (GIOSchedulerJob *sched_job,
MbReleaseFilter filter;
MbRelease release;
MbResultList results;
- gint results_len, idx;
+ gint results_len = 0, idx;
gchar *retval = NULL;
query = mb_query_new (NULL, NULL);
@@ -226,7 +226,9 @@ fetch_uri_job (GIOSchedulerJob *sched_job,
filter = mb_release_filter_artist_name (filter, job->artist);
results = mb_query_get_releases (query, filter);
- results_len = mb_result_list_get_size (results);
+
+ if (results)
+ results_len = mb_result_list_get_size (results);
for (idx = 0; idx < results_len; idx++) {
gchar asin[255];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]