mirror of
https://github.com/koush/scrypted.git
synced 2026-02-13 02:12:58 +00:00
server: plugin device deletion crash fix
This commit is contained in:
@@ -186,7 +186,7 @@ export class PluginHostAPI extends PluginAPIManagedListeners implements PluginAP
|
||||
|
||||
async requestRestart() {
|
||||
const logger = await this.getLogger(undefined);
|
||||
logger.log('i', 'plugin restart was requested');
|
||||
logger?.log('i', 'plugin restart was requested');
|
||||
return this.restartDebounced();
|
||||
}
|
||||
|
||||
|
||||
@@ -231,6 +231,8 @@ export class ScryptedRuntime extends PluginHttp<HttpPluginData> {
|
||||
}
|
||||
|
||||
getDeviceLogger(device: PluginDevice): Logger {
|
||||
if (!device)
|
||||
return;
|
||||
return this.devicesLogger.getLogger(device._id, getState(device, ScryptedInterfaceProperty.name));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user