mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
check for runtime error during db query (#2834)
This commit is contained in:
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user