NotificationWidget: changed code to prevent a potential exception when the user clicks the widget.

Mon, 08 Mar 2021 16:55:00 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 08 Mar 2021 16:55:00 +0100
changeset 8154
5f4b02eefc32
parent 8152
0c740fcffd34
child 8156
26b8f5561acb

NotificationWidget: changed code to prevent a potential exception when the user clicks the widget.

eric6/UI/NotificationWidget.py file | annotate | diff | comparison | revisions
--- a/eric6/UI/NotificationWidget.py	Thu Mar 04 19:39:54 2021 +0100
+++ b/eric6/UI/NotificationWidget.py	Mon Mar 08 16:55:00 2021 +0100
@@ -257,8 +257,9 @@
         """
         if not self.__settingPosition:
             clickedLabel = self.childAt(evt.pos())
-            clickedNotification = clickedLabel.parent()
-            self.__removeNotification(clickedNotification)
+            if clickedLabel:
+                clickedNotification = clickedLabel.parent()
+                self.__removeNotification(clickedNotification)
             return
         
         if evt.button() == Qt.MouseButton.LeftButton:

eric ide

mercurial