Skip to content

Commit

Permalink
Be defensive in case the queue state failed to load
Browse files Browse the repository at this point in the history
  • Loading branch information
sodabrew committed Oct 19, 2015
1 parent 448e0f1 commit 0fde4e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/public/js/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ domready(function() {
for (var state in queues["messages"]) {
var list = document.getElementById("list-" + state);
if (list) {

// Be defensive in case the queue state failed to load
if (!queues["messages"][state]) {
continue;
}

// Post the date prefix above each day's messages
var last_date = "";

// Zap everything in the list and then populate it again.
// TODO: avoid refreshing everything, DOM redraws are a pain.
list.innerHTML = "";
Expand Down

0 comments on commit 0fde4e7

Please sign in to comment.