Fix geizhals crash if no price found (#19197)

* Fix geizhals crash if no price found

* Return None on unknown price.

* Linting

* Linting the linting
This commit is contained in:
Lukas Barth 2018-12-12 16:11:18 +01:00 committed by Fabian Affolter
parent 7de509dc76
commit 4984030871

View File

@ -80,6 +80,9 @@ class Geizwatch(Entity):
@property @property
def state(self): def state(self):
"""Return the best price of the selected product.""" """Return the best price of the selected product."""
if not self._device.prices:
return None
return self._device.prices[0] return self._device.prices[0]
@property @property