Skip to content

Commit

Permalink
Merge pull request #148 from tjmabey/get-cache-error-handling
Browse files Browse the repository at this point in the history
#147: improve the get cache function to handle errors
  • Loading branch information
JorgenEvens authored Dec 17, 2018
2 parents 8ec72f0 + 2c036cf commit 038fdd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export default {
}
},
get(key) {
// cache not available
if (!_hasLocalStorage)
return null;

const value = localStorage.getItem(CACHE_PREFIX + key);

if (value)
Expand Down

0 comments on commit 038fdd0

Please sign in to comment.