From: unknown Date: Tue, 1 May 2012 15:54:35 +0000 (+0200) Subject: correction of bug oc-393 in using owncloud V2, V3, V4 with android browser : X-Git-Tag: v4.0.0beta~112^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=98e0db15a22ced037b6caea4389ccf729e453cdf;p=nextcloud-server.git correction of bug oc-393 in using owncloud V2, V3, V4 with android browser : JSON.parse(null) results in 'Uncaught illegal access' and not 'null' (see google for details) solved Signed-off-by: bourgeoa --- diff --git a/core/js/js.js b/core/js/js.js index 12303d7dd91..f697f2b8537 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -171,6 +171,7 @@ if(typeof localStorage !='undefined'){ return localStorage.setItem(OC.localStorage.namespace+name,JSON.stringify(item)); }, getItem:function(name){ + if(localStorage.getItem(OC.localStorage.namespace+name)==null){return null;} return JSON.parse(localStorage.getItem(OC.localStorage.namespace+name)); } };