Fix additional IQVIA data bug (#23931)

This commit is contained in:
Aaron Bach 2019-05-16 18:30:09 -06:00 committed by GitHub
parent 03a0a3572b
commit 1b5f526e09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,8 +106,8 @@ class ForecastSensor(IQVIAEntity):
if not self._iqvia.data: if not self._iqvia.data:
return return
data = self._iqvia.data[self._type]['Location'] data = self._iqvia.data[self._type].get('Location')
if not data.get('periods'): if not data or not data.get('periods'):
return return
indices = [p['Index'] for p in data['periods']] indices = [p['Index'] for p in data['periods']]