Skip to content

Node.js based forum software built for the modern web

handling missing notifications in update script

Julian Lam01340c87bd90
diff --git a/src/upgrade.js b/src/upgrade.js
index 67b349f226..c2d98fbb40 100644
--- a/src/upgrade.js
+++ b/src/upgrade.js
@@ -54,7 +54,9 @@ Upgrade.upgrade = function() {
RDB.zrange(key, 0, -1, function(err, nids) {
async.each(nids, function(nid, next) {
notifications.get(nid, null, function(notif_data) {
- RDB.zadd(key, notif_data.datetime, nid, next);
+ if (notif_data) {
+ RDB.zadd(key, notif_data.datetime, nid, next);
+ }
});
}, next);
});