From ef8dfc082c49de9d347999f5e1557f8cd916b2ec Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 28 May 2012 22:09:21 +0200 Subject: [PATCH] Don't get last of empty list --- couchpotato/core/notifications/core/static/notification.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/notifications/core/static/notification.js b/couchpotato/core/notifications/core/static/notification.js index 4cf71e0..d11b640 100644 --- a/couchpotato/core/notifications/core/static/notification.js +++ b/couchpotato/core/notifications/core/static/notification.js @@ -136,7 +136,8 @@ var NotificationBase = new Class({ App.fireEvent(result.type, result) }) - self.last_id = json.result.getLast().message_id + if(json.result.length > 0) + self.last_id = json.result.getLast().message_id } // Restart poll