Merge pull request #57 from outis1one/claude/fervent-dirac-ldwaki
Fix: guard load_plugins() so helper files without a default export do…
This commit is contained in:
@@ -46,7 +46,9 @@ class GUI_tools_class {
|
|||||||
moduleKey = parts[parts.length - 1];
|
moduleKey = parts[parts.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
var classObj = plugins_context(key);
|
var classObj = plugins_context(key);
|
||||||
|
if (!classObj.default) return; // skip helper files without a default export
|
||||||
var object = new classObj.default(ctx);
|
var object = new classObj.default(ctx);
|
||||||
|
|
||||||
var title = _this.Helper.ucfirst(object.name);
|
var title = _this.Helper.ucfirst(object.name);
|
||||||
@@ -64,6 +66,9 @@ class GUI_tools_class {
|
|||||||
if(typeof object.load != "undefined") {
|
if(typeof object.load != "undefined") {
|
||||||
object.load();
|
object.load();
|
||||||
}
|
}
|
||||||
|
} catch(e) {
|
||||||
|
console.error('[load_plugins] Failed to load ' + key + ':', e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user