[shotwell] gnome-photos: Don't crash on missing title



commit 3acd6b706fc2fa1f2d768492e4308f0bac04ccf3
Author: Jens Georg <mail jensge org>
Date:   Sat Jul 27 21:08:15 2019 +0200

    gnome-photos: Don't crash on missing title
    
    Apparently there is a possibility that there is a single-item photo
    which is also prsented as an album, but doesn't bear a title.
    
    Skip those as well.
    
    Fixes #149

 plugins/shotwell-publishing/PhotosPublisher.vala | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/shotwell-publishing/PhotosPublisher.vala 
b/plugins/shotwell-publishing/PhotosPublisher.vala
index d878158d..ce5e5053 100644
--- a/plugins/shotwell-publishing/PhotosPublisher.vala
+++ b/plugins/shotwell-publishing/PhotosPublisher.vala
@@ -203,9 +203,10 @@ private class AlbumDirectoryTransaction : Publishing.RESTSupport.GooglePublisher
             var response_albums = object.get_member ("albums").get_array();
             response_albums.foreach_element( (a, b, element) => {
                 var album = element.get_object();
+                var title = album.get_member("title");
                 var is_writable = album.get_member("isWriteable");
-                if (is_writable != null && is_writable.get_boolean())
-                    albums += new Album(album.get_string_member("title"), album.get_string_member("id"));
+                if (title != null && is_writable != null && is_writable.get_boolean())
+                    albums += new Album(title.get_string(), album.get_string_member("id"));
             });
 
             if (pagination_token_node != null) {


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