Check for existence of localStorage object before trying to index it.
Merge pull request #1 from phardy/master

Check for existence of localStorage object before trying to index it.