added line to prevent JSON errors to crash the whole thing

This commit is contained in:
dickreckard 2014-11-06 11:59:54 +01:00
parent 65720bf3b6
commit 943cbd3562

View File

@ -268,8 +268,12 @@ function updateInboxView() {
if ( localStorage.key(i).length < 10 || element === 'outbox' ) { if ( localStorage.key(i).length < 10 || element === 'outbox' ) {
continue; continue;
} }
// alert(element); // alert(element);
elementj = JSON.parse(element); try {
elementj = JSON.parse(element);
} catch (e) {
continue;
}
localStorageArray[i] = { time:localStorage.key(i), user:elementj.name, message:elementj.message, node:elementj.node, hops:elementj.hops }; localStorageArray[i] = { time:localStorage.key(i), user:elementj.name, message:elementj.message, node:elementj.node, hops:elementj.hops };
} }