diff --git a/CHANGELOG.md b/CHANGELOG.md index a23a22f72..5b61e8173 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ The links to individual versions below are to copies of the script with the upda ### v1.10.1 +**v1.10.1.16** *(2015-02-26)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.1.16/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.1.16/builds/4chan-X-noupdate.crx "Chromium version")] +- Fix thread watcher data corruption issue. + **v1.10.1.15** *(2015-02-23)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.1.15/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.1.15/builds/4chan-X-noupdate.crx "Chromium version")] - (VoH) Restore Nyafuu archive. diff --git a/src/General/lib/databoard.class b/src/General/lib/databoard.class index a59ae8f46..106d1ce39 100755 --- a/src/General/lib/databoard.class +++ b/src/General/lib/databoard.class @@ -50,8 +50,8 @@ class DataBoard get: ({boardID, threadID, postID, defaultValue}) -> if board = @data.boards[boardID] - unless threadID - if postID + unless threadID? + if postID? for ID, thread in board if postID of thread val = thread[postID] @@ -59,7 +59,7 @@ class DataBoard else val = board else if thread = board[threadID] - val = if postID + val = if postID? thread[postID] else thread diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 23ca14ead..20285d040 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -134,8 +134,8 @@ ThreadWatcher = {db} = ThreadWatcher boardID = g.BOARD.ID db.forceSync() - for threadID, data of db.data.boards[boardID] when not data.isDead and threadID not of g.BOARD.threads - if Conf['Auto Prune'] + for threadID, data of db.data.boards[boardID] when not data?.isDead and threadID not of g.BOARD.threads + if Conf['Auto Prune'] or not (data and typeof data is 'object') ThreadWatcher.db.delete {boardID, threadID} else data.isDead = true @@ -248,7 +248,7 @@ ThreadWatcher = for boardID, threads of ThreadWatcher.db.data.boards if Conf['Current Board'] and boardID isnt g.BOARD.ID continue - for threadID, data of threads + for threadID, data of threads when data and typeof data is 'object' all.push {boardID, threadID, data} all