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.
If you call
unload()
but haven't calledload(...)
before, there will be an unhandled exception caused bythis._logSpy.restore()
(index.js:257), becausethis._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