Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unloading throws an error if nothing has been loaded before #38

Open
tt92 opened this issue Sep 2, 2019 · 0 comments
Open

unloading throws an error if nothing has been loaded before #38

tt92 opened this issue Sep 2, 2019 · 0 comments

Comments

@tt92
Copy link

tt92 commented Sep 2, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant