From 8b37d122b9eb5a8902d71d2e88d990a3906194a9 Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Sat, 30 Jul 2016 15:11:49 +0200 Subject: [PATCH] Fixed bug in countSubAlbums. --- src/scripts/contextMenu.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/scripts/contextMenu.js b/src/scripts/contextMenu.js index 382beff..ba46ce0 100644 --- a/src/scripts/contextMenu.js +++ b/src/scripts/contextMenu.js @@ -211,11 +211,13 @@ contextMenu.photo = function(photoID, e) { function countSubAlbums(photoIDs) { let count = 0 - for (i in photoIDs) { - for (j in album.subjson.albums) { - if (album.subjson.albums[j].id == photoIDs[i]) { - count++ - break + if (album.subjson) { + for (i in photoIDs) { + for (j in album.subjson.albums) { + if (album.subjson.albums[j].id == photoIDs[i]) { + count++ + break + } } } }