Skip to content

fix(mission): clear error when the waypoint CSV has no waypoints#7

Merged
wietzesuijker merged 1 commit into
mainfrom
fix/mission-file-guards
Jun 7, 2026
Merged

fix(mission): clear error when the waypoint CSV has no waypoints#7
wietzesuijker merged 1 commit into
mainfrom
fix/mission-file-guards

Conversation

@wietzesuijker

Copy link
Copy Markdown
Member

When the waypoint CSV contains no wpt rows, BuildTemplateKML.setup and BuildWaylinesWPML.setup crashed deep in setup with an opaque IndexError on cpt_csv_properties[-1].

Both now raise a clear ValueError up front when there are zero waypoints, naming the CSV path and stating that a mission needs at least one waypoint.

Adds a regression test for the empty-waypoint case. 22 tests pass.


AI (Claude) supported my development of this PR.

setup() in both the WPML and KML builders did cpt_csv_properties[-1] on a copy
of an empty wpt list when a CSV had zero type='wpt' rows, raising a cryptic
IndexError. Raise a clear ValueError naming the CSV instead. Regression test on
the WPML builder (no network).
@wietzesuijker wietzesuijker merged commit f6c6671 into main Jun 7, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant