From 008d787e7fa99a4123f302a6b9ed5c308ba4850e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 22 Nov 2021 12:06:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20"no=20file=20selected"=20d?= =?UTF-8?q?etection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Got broken in fix for #4212, thanks @cp2004 for the heads-up. --- .../static/js/app/viewmodels/files.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index 94b1c9297..10d268c70 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -337,7 +337,7 @@ $(function () { }; self.highlightFile = function (file) { - if (!file) { + if (!file || !file.origin || !file.path) { self.listHelper.selectNone(); return; } @@ -352,13 +352,15 @@ $(function () { } }); if (!result) { - log.info( - "Couldn't find file " + - file.origin + - ":" + - file.path + - " in current items, not selecting" - ); + if (log.getLevel() <= log.levels.DEBUG) { + log.info( + "Couldn't find file " + + file.origin + + ":" + + file.path + + " in current items, not selecting" + ); + } self.listHelper.selectNone(); } };