Add guard for nonexistent pattern to match with.

This commit is contained in:
gryf committed 2022-09-16 17:08:59 +02:00
1 parent 6f9b91d525
commit 1f51add078
1 file changed
+3
+3
View File
@@ -233,6 +233,9 @@ class SensorDockApp(wmdocklib.DockApp):
if shw.label == item.get('label'):
temp = shw
break
else:
# in case there is no items matched.
return ' ', 0
value = int(temp.current)
name = item.get('name')