mirror of
https://github.com/koush/scrypted.git
synced 2026-02-13 18:32:56 +00:00
server: fix state nre
This commit is contained in:
@@ -29,10 +29,6 @@ import { Alerts } from './services/alerts';
|
||||
import { Info } from './services/info';
|
||||
import io from 'engine.io';
|
||||
import {spawn as ptySpawn} from 'node-pty';
|
||||
import child_process from 'child_process';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { ensurePluginVolume } from './plugin/plugin-volume';
|
||||
|
||||
interface DeviceProxyPair {
|
||||
handler: PluginDeviceProxyHandler;
|
||||
|
||||
@@ -236,7 +236,7 @@ export function setState(pluginDevice: PluginDevice, property: string, value: an
|
||||
}
|
||||
|
||||
export function getState(pluginDevice: PluginDevice, property: string): any {
|
||||
const ret = pluginDevice.state[property]?.value;
|
||||
const ret = pluginDevice.state?.[property]?.value;
|
||||
if (typeof ret === 'object')
|
||||
return JSON.parse(JSON.stringify(ret));
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user