Skip to content

Commit

Permalink
fix(core): check key on storage event argument exists
Browse files Browse the repository at this point in the history
When localStorage of application is cleared manually on the fly, this will break since event.key === null. Hence added in a check if it exists as well.
  • Loading branch information
anu91ab authored and grbsk committed Jul 16, 2018
1 parent b79ffde commit 2fc712d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/core/src/storageinterruptsource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class StorageInterruptSource extends WindowInterruptSource {
* @return True if the event should be filtered (don't cause an interrupt); otherwise, false.
*/
filterEvent(event: StorageEvent): boolean {
if (event.key.indexOf('ng2Idle.') >= 0 && event.key.indexOf('.expiry') >= 0) {
if (event.key && event.key.indexOf('ng2Idle.') >= 0 && event.key.indexOf('.expiry') >= 0) {
return false;
}
return true;
Expand Down

0 comments on commit 2fc712d

Please sign in to comment.