From 9c22e578ac9d3e3d544fe87191790915620bef26 Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Tue, 20 May 2014 10:51:38 +0200 Subject: [PATCH] Bug fix: if no local storage, this.user = false --- portal/static/js/myslice.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/portal/static/js/myslice.js b/portal/static/js/myslice.js index 2f866553..d9593af7 100644 --- a/portal/static/js/myslice.js +++ b/portal/static/js/myslice.js @@ -106,7 +106,11 @@ var myslice = { user: function() { if ($.isEmptyObject(this.user)) { //this.login(function() { return this.user; }); - this.user = JSON.parse(localStorage.getItem('user')); + if(localStorage.getItem('user')!='undefined'){ + this.user = JSON.parse(localStorage.getItem('user')); + }else{ + return false; + } } return this.user; }, -- 2.43.0