node-red-node-test-helper icon indicating copy to clipboard operation
node-red-node-test-helper copied to clipboard

unloading throws an error if nothing has been loaded before

Open tt92 opened this issue 6 years ago • 0 comments

If you call unload() but haven't called load(...) before, there will be an unhandled exception caused by this._logSpy.restore() (index.js:257), because this._logSpy is undefined.

This might be a rare use-case but to me unloading should be possible even if there is nothing to unload.

Therefore, I suggest to wrap this line into a if(this._logSpy) { ... } or to add some other form of error handling.

Cheers,

TT

tt92 avatar Sep 02 '19 12:09 tt92