mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
check for runtime error during db query (#2834)
This commit is contained in:
committed by
Paulus Schoutsen
parent
27e27ee156
commit
d281a7260d
@@ -78,6 +78,8 @@ class SpeedtestSensor(Entity):
|
||||
).order_by(states.state_id.desc()).limit(1))
|
||||
except TypeError:
|
||||
return
|
||||
except RuntimeError:
|
||||
return
|
||||
if not last_state:
|
||||
return
|
||||
self._state = last_state[0].state
|
||||
|
@@ -97,6 +97,8 @@ class SpeedtestSensor(Entity):
|
||||
).order_by(states.state_id.desc()).limit(1))
|
||||
except TypeError:
|
||||
return
|
||||
except RuntimeError:
|
||||
return
|
||||
if not last_state:
|
||||
return
|
||||
self._state = last_state[0].state
|
||||
|
Reference in New Issue
Block a user