1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Ensure node.types is defined if node html file missing

This commit is contained in:
Nick O'Leary 2021-07-12 16:09:02 +01:00
parent e7efa76e6d
commit 36eddabc1c
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -223,8 +223,8 @@ async function loadNodeTemplate(node) {
// ENOENT means no html file. We can live with that. But any other error // ENOENT means no html file. We can live with that. But any other error
// should be fatal // should be fatal
// node.err = "Error: "+node.template+" does not exist"; // node.err = "Error: "+node.template+" does not exist";
node.types = node.types || [];
if (err.code !== 'ENOENT') { if (err.code !== 'ENOENT') {
node.types = [];
node.err = err.toString(); node.err = err.toString();
} }
return node; return node;
@ -263,7 +263,7 @@ async function loadNodeConfig(fileInfo) {
if (info.hasOwnProperty("loaded")) { if (info.hasOwnProperty("loaded")) {
throw new Error(file+" already loaded"); throw new Error(file+" already loaded");
} }
isEnabled = info.enabled; isEnabled = !(info.enabled === false);
} }
var node = { var node = {
@ -353,6 +353,7 @@ async function loadPluginConfig(fileInfo) {
*/ */
function loadNodeSet(node) { function loadNodeSet(node) {
if (!node.enabled) { if (!node.enabled) {
console.log("BAIL ON",node.id)
return Promise.resolve(node); return Promise.resolve(node);
} else { } else {
} }