Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
web storage adapter checks for null. AEROGEAR-1076
Browse files Browse the repository at this point in the history
  • Loading branch information
lholmquist committed Apr 8, 2013
1 parent 0101e60 commit cc76ebc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/data-manager/adapters/session-local.js
Expand Up @@ -48,7 +48,8 @@ AeroGear.DataManager.adapters.SessionLocal = function( storeName, settings ) {
name = storeName,
appContext = document.location.pathname.replace(/[\/\.]/g,"-"),
storeKey = name + appContext,
currentData = JSON.parse( window[ storeType ].getItem( storeKey ) );
content = window[ storeType ].getItem( storeKey ),
currentData = content ? JSON.parse( content ) : null ;

// Initialize data from the persistent store if it exists
if ( currentData ) {
Expand Down

0 comments on commit cc76ebc

Please sign in to comment.