Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/services/ardupilot_manager/api/v1/routers/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async def install_firmware_from_file(
)
@index_to_http_exception
def get_board() -> Any:
return autopilot.current_board
return autopilot.current_board_sanitized


@index_router_v1.post("/board", summary="Set board to be used.")
Expand Down
7 changes: 7 additions & 0 deletions core/services/ardupilot_manager/autopilot_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,13 @@ async def start_mavlink_manager_watchdog(self) -> None:
def current_board(self) -> Optional[FlightController]:
return self._current_board

@property
def current_board_sanitized(self) -> Optional[FlightController]:
board = self._current_board
if board and board.path and not pathlib.Path(board.path).exists():
return None
return board

@property
def current_sitl_frame(self) -> SITLFrame:
return self._current_sitl_frame
Expand Down