From f0002ceb59e9ce1cc513e61c2a46960045b95322 Mon Sep 17 00:00:00 2001 From: Youta EGUSA Date: Wed, 25 Jul 2018 19:55:30 +0900 Subject: [PATCH] Verify whether the albums response is empty --- google-photo.lrplugin/GPhotoAPI.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/google-photo.lrplugin/GPhotoAPI.lua b/google-photo.lrplugin/GPhotoAPI.lua index d2cc759..caceadb 100644 --- a/google-photo.lrplugin/GPhotoAPI.lua +++ b/google-photo.lrplugin/GPhotoAPI.lua @@ -377,6 +377,9 @@ function GPhotoAPI.listAlbums(propertyTable) local json = require 'json' local results = json.decode(result) nextPageToken = results["nextPageToken"] + if not results.albums then + break + end for i,v in ipairs(results.albums) do albums[#albums+1] = v end