grevory/angular-local-storage — pull request #95 by georgebonnr (2014-05-12 23:06:26+00:00)
Title: fix unhandled errors in chrome

$window[storageType] would throw unhandled error in Chrome some cases as browserSupportsLocalStorage() had not yet been called. This PR fixes issue https://github.com/grevory/angular-local-storage/issues/81

Note that moving webStorage assignment below supportsLocalStorage() will set webStorage to $window['cookie'] if exception is thrown in supportsLocalStorage().

May be safer to just set webStorage to null, since supportsLocalStorage() checking is done independently in most methods before webStorage is referenced – or to do away with webStorage var altogether and just reference $window['desired storage type'] explicitly in helper methods.

But this was the smallest change that would fix unhandled error.