Skip to content

Commit 69dc6e9

Browse files
authored
Добавил try...catch в закрытие уведомлений
1 parent 1383118 commit 69dc6e9

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

jsTimer.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,18 @@ function deleteTimer(MouseEvent)
7474
{
7575
timers.splice(curI, 1);
7676

77-
var notification = notificationObjects[cur.id];
78-
if (notification instanceof Notification)
77+
try
7978
{
80-
notification.close();
81-
delete notificationObjects[cur.id];
79+
var notification = notificationObjects[cur.id];
80+
if (notification instanceof Notification)
81+
{
82+
notification.close();
83+
delete notificationObjects[cur.id];
84+
}
85+
}
86+
catch (e)
87+
{
88+
console.error(e);
8289
}
8390

8491
saveTimers();

0 commit comments

Comments
 (0)