Fix JS exception where localStorage is empty

main
Ryan Rix 2017-07-03 22:33:54 -05:00
parent 5eefb6fa67
commit c63ddbda5c
1 changed files with 3 additions and 2 deletions

View File

@ -5,8 +5,9 @@ var updateCache = function() {
}
var primeCache = function() {
strCache = window.localStorage.getItem('cache').split(",") || []; // Augh.
cache = [];
var string = window.localStorage.getItem('cache') || "";
var strCache = string.split(",");
var cache = [];
strCache.map(function(item) {
cache[cache.length] = (item == 'true');
setRowValue(cache.length, cache[cache.length-1]);