Fix null object in search for users with no preferences set.

localStorage.getItem returned null, and JSON.parse(null) is null.
v1.18.x
Ben Lubar 9 years ago
parent dbdbfc6d75
commit 598935b3bf
No known key found for this signature in database
GPG Key ID: 018BAB45DB2D2B24

@ -75,7 +75,7 @@ define('search', ['navigator', 'translator'], function(nav, translator) {
Search.getSearchPreferences = function() {
try {
return JSON.parse(localStorage.getItem('search-preferences'));
return JSON.parse(localStorage.getItem('search-preferences') || '{}');
} catch(e) {
return {};
}

Loading…
Cancel
Save