From 64c26c7e5de0b5403428f3576b4ede0aa4518f3c Mon Sep 17 00:00:00 2001 From: Johan Kwarnmark Date: Tue, 4 May 2021 17:13:33 +0200 Subject: [PATCH] To avoid the pop up and save the error in the log --- src/renderer/notification-handler.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/renderer/notification-handler.ts b/src/renderer/notification-handler.ts index d08f5f9b..913b591d 100644 --- a/src/renderer/notification-handler.ts +++ b/src/renderer/notification-handler.ts @@ -63,7 +63,17 @@ export default class NotificationHandler { y: number = 0, ) { if (window && !window.isDestroyed()) { - window.setPosition(parseInt(String(x), 10), parseInt(String(y), 10)); + try { + window.setPosition(parseInt(String(x), 10), parseInt(String(y), 10)); + } catch (err) { + console.warn( + 'Failed to set window position. x: ' + + x + + ' y: ' + + y + + '. Contact the developers for more details', + ); + } } }