diff options
author | Struan Donald <struan@exo.org.uk> | 2012-11-14 18:02:48 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-11-14 18:02:48 +0000 |
commit | d172d0fefbd791c5a360ea7166da5946e90d3914 (patch) | |
tree | 0b88ee7c9993959e815fa1a12fe6fabeb569518d /www/js | |
parent | b3dc04a750c91315f6d3c8aef45a4461d16d7e0b (diff) |
fix fetching empty saved report list bug on android
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/mobile.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/www/js/mobile.js b/www/js/mobile.js index a9a59a7..c536fcb 100644 --- a/www/js/mobile.js +++ b/www/js/mobile.js @@ -5,7 +5,14 @@ Storage.prototype.setObject = function(key, value) { }; Storage.prototype.getObject = function(key) { - return JSON.parse(this.getItem(key)); + var item = this.getItem(key); + // if we try to parse an empty thing on Android then + // it falls over :( + if ( item ) { + return JSON.parse(item); + } else { + return null; + } }; function touchmove(e) { |