node-zklib icon indicating copy to clipboard operation
node-zklib copied to clipboard

Adding error handling to readWithBuffer function

Open AndreHrs opened this issue 3 years ago • 0 comments

When machine does not have logs data stored (Mine was ZKTeco K20), This library will cease to function (not throwing exception and just failed) The original code tried to decode header which was empty or trying to access commandId from empty object

I just added exception handling to readWithBuffer function so it will reject the promise and does not stop the whole code from running.

-- Additional Comment -- Also, sorry for the lint I forgot to disable the lint on save function.

AndreHrs avatar Oct 21 '21 09:10 AndreHrs