Looks like some users had a null value on a board with the Unread features.

No idea how that could have happened.
This commit is contained in:
Mayhem 2013-05-13 18:44:22 +02:00
parent fd3d898f75
commit 215761557d

View File

@ -56,17 +56,13 @@ class DataBoard
val or defaultValue
clean: ->
for boardID of @data.boards
try
@deleteIfEmpty {boardID}
catch err
# XXX I get obscure reports of:
# "Unread" initialization crashed. TypeError: Object.keys called on non-object
# comming from here, gotta figure out why that happens.
Main.logError
message: "Couldn't deleteIfEmpty on:\n#{JSON.stringify @data}\n"
error: err
for boardID, val of @data.boards
# XXX tmp fix for users that had the `null`
# value for a board with the Unread features:
unless val
delete @data.boards[boardID]
else
@deleteIfEmpty {boardID}
now = Date.now()
if (@data.lastChecked or 0) < now - 2 * $.HOUR