From 22d5e417e4be5459976ba34b864adfe74328c51d Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 1 Oct 2019 11:46:52 +0200 Subject: [PATCH] Prevent infinite loop in the drive --- www/common/drive-ui.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index d1b360bdf..e337bd386 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -3245,6 +3245,11 @@ define([ if (!isVirtual && typeof(root) === "undefined") { log(Messages.fm_unknownFolderError); debug("Unable to locate the selected directory: ", path); + if (path.length === 1 && path[0] === ROOT) { + // Somehow we can't display ROOT. We should abort now because we'll + // end up in an infinite loop + return void UI.warn(Messages.fm_error_cantPin); // Internal server error, please reload... + } var parentPath = path.slice(); parentPath.pop(); _displayDirectory(parentPath, true);