storage.js - fix case str is undefined

str.indexOf('{') throw exception when str undefined.
JSON.parse(str) too.