Export: no panic on vehicle parts without coat entries #256

Manually merged
github merged 1 commit from gh-pr/256/head into gh-pr/256/base 2026-11-26 20:22:02 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 11:31 UTC · original
holdmysocks:claude/coat-export-panic → master · +4 −1 · 1 files · 1 commits · merged 2026-11-25 11:50 UTC

What

Since PR 253 the export panics ("no entry found for key") on a model whose part looks carry no coat entries: every shared library part (a wheel, a light bar, a truck bed, whose looks are only {"shared": true}) and any model without a body paint coat. In the viewer the load thread dies and the vehicle never appears; a CLI export of such a model aborts. SIX-205.

Cause: the new part_colours.coat block read four keys with o["key"] on a JSON map, which panics on a missing key (indexing a JSON value does not).

Fix: the four keys are read with get, null when absent. One statement in export.rs.

Checked

  • Before: loading a car that fits shared parts in the viewer panics at that line (seen on the build of master's code).
  • After: the same car and two others load and render in the viewer with this fix, no panic in the log.

Not decoded / not done

  • No regression test: the statement sits at the end of the drawable build, which has no unit test harness. CI runs the workspace tests.
  • Not run through a CLI export.
**@⁠holdmysocks** on GitHub · 2026-11-25 11:31 UTC · [original](https://github.com/holdmysocks/SixNG/pull/256) `holdmysocks:claude/coat-export-panic` → `master` · +4 −1 · 1 files · 1 commits · merged 2026-11-25 11:50 UTC ## What Since PR 253 the export panics ("no entry found for key") on a model whose part looks carry no coat entries: every shared library part (a wheel, a light bar, a truck bed, whose looks are only `{"shared": true}`) and any model without a body paint coat. In the viewer the load thread dies and the vehicle never appears; a CLI export of such a model aborts. SIX-205. Cause: the new `part_colours.coat` block read four keys with `o["key"]` on a JSON map, which panics on a missing key (indexing a JSON value does not). Fix: the four keys are read with `get`, null when absent. One statement in `export.rs`. ## Checked - Before: loading a car that fits shared parts in the viewer panics at that line (seen on the build of master's code). - After: the same car and two others load and render in the viewer with this fix, no panic in the log. ## Not decoded / not done - No regression test: the statement sits at the end of the drawable build, which has no unit test harness. CI runs the workspace tests. - Not run through a CLI export.
The part_colours.coat block indexed a JSON map by key, which panics when the key is missing: shared library parts and models without a body paint coat have none of the four. Read them with get.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:22:00 +00:00
github manually merged commit 380700f613 into gh-pr/256/base 2026-11-26 20:22:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.