eu-evops / homebridge-hikvision

28 stars 21 forks source link

TypeError: Cannot read property 'length' #14

Open Andyyy opened 3 years ago

Andyyy commented 3 years ago

Hello, for the past few days I have been struggling with this plugin for HikVision NVR. I did overcome one issue, but this one appeared... and I don't know how to get past it. Does anyone have idea how to solve this? Also I am using only Analog cameras and I hope that this is not the problem.. Thanks for your imput :)

[02/01/2021, 18:34:00] Homebridge is running on port 51872. [02/01/2021, 18:34:00] [Hikvision] Connected to NVR system: { DeviceInfo: { '$': { version: '1.0', xmlns: 'http://www.hikvision.com/ver20/XMLSchema' }, deviceName: 'Recorder Tabenda', deviceID: 'XXXXXXXXXXXX, model: 'DS-7216HQHI-K1', serialNumber: 'XXXXXXXXXXXX', macAddress: 'XXXXXXXXXXX', firmwareVersion: 'V4.20.000', firmwareReleasedDate: 'build 181107', encoderVersion: 'V5.0', encoderReleasedDate: 'build 181017', deviceType: 'IPC', telecontrolID: '255', hardwareVersion: '0x93b00' } } [02/01/2021, 18:34:00] [Hikvision] Loading cameras... (node:1510) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined at HikvisionApi.<anonymous> (/usr/local/lib/node_modules/@evops/homebridge-hikvision/src/HikvisionApi.ts:60:74) at Generator.next (<anonymous>) at fulfilled (/usr/local/lib/node_modules/@evops/homebridge-hikvision/dist/HikvisionApi.js:24:58) at processTicksAndRejections (internal/process/task_queues.js:93:5) (Usenode --trace-warnings ...to show where the warning was created) (node:1510) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4) (node:1510) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

jejenone commented 3 years ago

I'm having the same issue. I haven't looked at the code yet.

purpleducks commented 3 years ago

Duplicate issue of #9 - do you only have analog cameras?