added null check on localstorage
Merge pull request #305 from agmcleod/hotfix/localstorage-null

added null check on localstorage