From 9d01cbf57e29e883d789257f998191597731db47 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 6 Apr 2016 11:21:51 +0200 Subject: [PATCH] user might have been removed --- static/js/folders.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/static/js/folders.js b/static/js/folders.js index 6eab258..0e5016a 100644 --- a/static/js/folders.js +++ b/static/js/folders.js @@ -330,16 +330,18 @@ oml.ui.folders = function() { library = lists.filter(function(list) { return list.user == name && list.type == 'library'; }); - oml.$ui.libraryList[index].options({ - items: library - }); - oml.$ui.folder[index].$content - .css({height: 16 + items.length * 16 + 'px'}); - oml.$ui.folderList[index].options({ - items: items - }) - .css({height: items.length * 16 + 'px'}) - .size(); + if (oml.$ui.libraryList[index]) { + oml.$ui.libraryList[index].options({ + items: library + }); + oml.$ui.folder[index].$content + .css({height: 16 + items.length * 16 + 'px'}); + oml.$ui.folderList[index].options({ + items: items + }) + .css({height: items.length * 16 + 'px'}) + .size(); + } oml.resizeListFolders(); callback && callback(); });