add some more trycatch for external code calls

This commit is contained in:
Jiiks 2018-01-21 01:46:49 +02:00
parent 6640fa1890
commit 4362d39624
1 changed files with 10 additions and 2 deletions

View File

@ -191,13 +191,21 @@ class PluginManager extends Module {
stopPlugin(name) {
const plugin = this.getPluginByName(name);
if (plugin && plugin.instance) return plugin.instance.stop();
try {
if (plugin && plugin.instance) return plugin.instance.stop();
} catch (err) {
Logger.err('PluginManager', err);
}
return true; //Return true anyways since plugin doesn't exist
}
startPlugin(name) {
const plugin = this.getPluginByName(name);
if (plugin && plugin.instance) return plugin.instance.start();
try {
if (plugin && plugin.instance) return plugin.instance.start();
} catch (err) {
Logger.err('PluginManager', err);
}
return true; //Return true anyways since plugin doesn't exist
}