From 148c5b5b507085c608fcd29c7bf674a087a887cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20Zi=C3=B3=C5=82kowski?= Date: Sun, 15 Sep 2024 01:41:46 +0200 Subject: [PATCH] fix crash on menu buttons without device selected, fixes #235 (#272) --- tdmgr/GUI/devices.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tdmgr/GUI/devices.py b/tdmgr/GUI/devices.py index 3c2dba5..60d0038 100644 --- a/tdmgr/GUI/devices.py +++ b/tdmgr/GUI/devices.py @@ -1,5 +1,6 @@ import os from json import dumps +from typing import Optional from PyQt5.QtCore import QDir, QSortFilterProxyModel, Qt, QUrl, pyqtSignal from PyQt5.QtGui import QColor, QIcon @@ -62,7 +63,7 @@ def __init__(self, parent, *args, **kwargs): self.mqtt = parent.mqtt self.env = parent.env - self.device: TasmotaDevice + self.device: Optional[TasmotaDevice] = None self.idx = None self.nam = QNetworkAccessManager()