From 895764e04755b46d30a79ce2d0ed7e9334bba991 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 4 Feb 2021 02:04:59 -0500 Subject: [PATCH] pluginfw: Return from `findUnmet()` early if not given an object For some reason strings are sometimes passed to `findUnmet()`, which is obviously unexpected given the way the code is written. Rather than figure out why strings are passed and how to safely avoid passing strings, just return early. The net effect is the same, but returning early avoids setting a property on a string, which is prohibited in strict mode. --- src/static/js/pluginfw/read-installed.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static/js/pluginfw/read-installed.js b/src/static/js/pluginfw/read-installed.js index dc331dae7..4c2a00880 100644 --- a/src/static/js/pluginfw/read-installed.js +++ b/src/static/js/pluginfw/read-installed.js @@ -250,6 +250,7 @@ function resolveInheritance(obj) { // No I/O const fuSeen = []; function findUnmet(obj) { + if (typeof obj !== 'object') return; if (fuSeen.indexOf(obj) !== -1) return; fuSeen.push(obj); const deps = obj.dependencies = obj.dependencies || {};