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

@ -269,7 +269,11 @@ function updateInboxView() {
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 };
} }