Cli: Fixes #2536: Fixed issue when a notebook does not have a parent

pull/2549/head
Laurent Cozic 2020-02-21 18:01:15 +00:00
parent c5f1f11f2d
commit 3cf3cd1598
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class FolderListWidget extends ListWidget {
let output = 0;
while (true) {
const folder = BaseModel.byId(folders, folderId);
if (!folder.parent_id) return output;
if (!folder || !folder.parent_id) return output;
output++;
folderId = folder.parent_id;
}