diff --git a/packages/adapter/src/lib/adapter/adapter.ts b/packages/adapter/src/lib/adapter/adapter.ts index 0fb8196104..4a0f3e5432 100644 --- a/packages/adapter/src/lib/adapter/adapter.ts +++ b/packages/adapter/src/lib/adapter/adapter.ts @@ -11885,7 +11885,7 @@ export class AdapterClass extends EventEmitter { // give it a chance to handle the error itself instead of restarting it if (typeof this._options.error === 'function') { try { - // if error handler in the adapter returned exactly true, + // if the error handler in the adapter returned exactly true, // we expect the error to be handled and do nothing more const wasHandled = this._options.error(err); if (wasHandled === true) { @@ -12178,8 +12178,11 @@ export class AdapterClass extends EventEmitter { }; this.pluginHandler = new PluginHandler(pluginSettings); - this.pluginHandler.addPlugins(this.ioPack.common.plugins, [this.adapterDir, __dirname]); // first resolve from adapter directory, else from js-controller - + try { + this.pluginHandler.addPlugins(this.ioPack.common.plugins, [this.adapterDir, __dirname]); // first resolve from adapter directory, else from js-controller + } catch (e) { + this._logger.error(`Could not add plugins: ${e.message}`); + } // finally init _initDBs(); } diff --git a/packages/common/src/lib/common/tools.ts b/packages/common/src/lib/common/tools.ts index e0cd7c4757..f35656e958 100644 --- a/packages/common/src/lib/common/tools.ts +++ b/packages/common/src/lib/common/tools.ts @@ -1525,7 +1525,7 @@ export async function sendDiagInfo(obj: Record): Promise { */ export function getAdapterDir(adapter: string): string | null { // snip off 'iobroker.' - if (adapter.toLowerCase().startsWith(appName.toLowerCase() + '.')) { + if (adapter.toLowerCase().startsWith(`${appNameLowerCase}.`)) { adapter = adapter.substring(appName.length + 1); } // snip off instance id