Skip to content

Commit

Permalink
add protection for null status (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolivierarsenault authored Nov 25, 2023
1 parent 62f3775 commit 2a443a2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/moonraker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ async def _gcode_file_detail_updater(coordinator):
data = await coordinator._async_fetch_data(
METHODS.PRINTER_OBJECTS_QUERY, coordinator.query_obj
)
return await coordinator._async_get_gcode_file_detail(
data["status"]["print_stats"]["filename"]
)
filename = ""
if "status" in data:
filename = data["status"]["print_stats"]["filename"]

return await coordinator._async_get_gcode_file_detail(filename)


class MoonrakerDataUpdateCoordinator(DataUpdateCoordinator):
Expand Down

0 comments on commit 2a443a2

Please sign in to comment.