mirror of
https://github.com/gryf/pywmtemp.git
synced 2025-12-19 20:27:59 +01:00
Add guard for nonexistent pattern to match with.
This commit is contained in:
@@ -233,6 +233,9 @@ class SensorDockApp(wmdocklib.DockApp):
|
|||||||
if shw.label == item.get('label'):
|
if shw.label == item.get('label'):
|
||||||
temp = shw
|
temp = shw
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
# in case there is no items matched.
|
||||||
|
return ' ', 0
|
||||||
|
|
||||||
value = int(temp.current)
|
value = int(temp.current)
|
||||||
name = item.get('name')
|
name = item.get('name')
|
||||||
|
|||||||
Reference in New Issue
Block a user