moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
315 stars 128 forks source link

LocalStorageExpiry bug #36

Closed npetillon closed 7 years ago

npetillon commented 7 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#getting-help

Current behavior

When I call the stop function on my Idle. This function call 'this.expiry.last(null)' with expiry instance of LocalStorageExpiry. The LocalStorageExpiry don't check the null value and throw the TypeError: Cannot read property 'getTime' of null TypeError: Cannot read property 'getTime' of null at LocalStorageExpiry

Expected behavior

Check null value when we set expiry in LocalStorageExpiry

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

npetillon commented 7 years ago

Pull request proposed : #35