From bc9c5646500405aa67b7a3dbdecb8b73ec88f334 Mon Sep 17 00:00:00 2001
From: barisusakli <barisusakli@gmail.com>
Date: Sat, 13 Feb 2016 15:24:22 +0200
Subject: [PATCH] closes #4169

---
 public/src/modules/notifications.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js
index a8f090028b..ec54fc0812 100644
--- a/public/src/modules/notifications.js
+++ b/public/src/modules/notifications.js
@@ -51,7 +51,7 @@ define('notifications', ['sounds', 'translator', 'components'], function(sound,
 
 			socket.emit('notifications.mark' + (unread ? 'Read' : 'Unread'), liEl.attr('data-nid'), function(err) {
 				if (err) {
-					app.alertError(err.message);
+					return app.alertError(err.message);
 				}
 
 				liEl.toggleClass('unread');
@@ -131,7 +131,7 @@ define('notifications', ['sounds', 'translator', 'components'], function(sound,
 
 	Notifications.updateNotifCount = function(count) {
 		var notifIcon = components.get('notifications/icon');
-
+		count = Math.max(0, count);
 		if (count > 0) {
 			notifIcon.removeClass('fa-bell-o').addClass('fa-bell');
 		} else {