Skip to content

Commit

Permalink
Added fallback return value to prevent NoneType error
Browse files Browse the repository at this point in the history
  • Loading branch information
g4bri3lDev committed Oct 9, 2024
1 parent 4ced8e1 commit b881aeb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/munich_public_transport/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ async def async_update_data():
}
except Exception as err:
_LOGGER.error(f"Error communicating with API: {err}", exc_info=True)
return None
return {
"all": [],
"grouped": {},
"next": None
}

coordinator = DataUpdateCoordinator(
hass,
Expand Down

0 comments on commit b881aeb

Please sign in to comment.