Skip to content

Commit 335e400

Browse files
authored
Merge pull request #311 from vkrizan/notification-timeout-remove
fix notification removed when not found
2 parents 3214cd4 + a47d4b2 commit 335e400

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/notification/notification.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ angular.module('patternfly.notification').provider('Notifications', function ()
181181
};
182182

183183
notifications.remove = function (notification) {
184-
notifications.removeIndex($rootScope.notifications.data.indexOf(notification));
184+
var index = $rootScope.notifications.data.indexOf(notification);
185+
if (index !== -1) {
186+
notifications.removeIndex(index);
187+
}
185188
};
186189

187190
notifications.removeIndex = function (index) {

0 commit comments

Comments
 (0)