[shotwell/shotwell-0.30] google-photos: Prevent critical on empty response



commit d9d7f5c0c3013a02e16af326830e023a514c59e3
Author: Jens Georg <mail jensge org>
Date:   Wed Jan 30 17:38:18 2019 +0100

    google-photos: Prevent critical on empty response

 plugins/shotwell-publishing/PhotosPublisher.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/plugins/shotwell-publishing/PhotosPublisher.vala 
b/plugins/shotwell-publishing/PhotosPublisher.vala
index ca9a2ec1..d878158d 100644
--- a/plugins/shotwell-publishing/PhotosPublisher.vala
+++ b/plugins/shotwell-publishing/PhotosPublisher.vala
@@ -195,6 +195,10 @@ private class AlbumDirectoryTransaction : Publishing.RESTSupport.GooglePublisher
             debug(this.get_response());
             var json = Json.from_string (this.get_response());
             var object = json.get_object ();
+            if (!object.has_member ("albums")) {
+                return;
+            }
+
             var pagination_token_node = object.get_member ("nextPageToken");
             var response_albums = object.get_member ("albums").get_array();
             response_albums.foreach_element( (a, b, element) => {


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