Skip to content

fix: handle empty blueprint exports from shopping list#627

Open
hcoona wants to merge 1 commit into
Yafc-CE:masterfrom
hcoona:dev/shuaizhang/fix-blueprint-empty-export
Open

fix: handle empty blueprint exports from shopping list#627
hcoona wants to merge 1 commit into
Yafc-CE:masterfrom
hcoona:dev/shuaizhang/fix-blueprint-empty-export

Conversation

@hcoona
Copy link
Copy Markdown

@hcoona hcoona commented May 9, 2026

Summary

Prevent empty shopping lists from crashing blueprint export.

Detailed explanation

The shopping list can legitimately produce an empty visible list depending on the selected state, such as Built or Missing. The export UI still allowed blueprint export in that state, while the blueprint exporter assumed at least one item and indexed into the first goods entry.

Example UI steps that trigger the issue

  1. Open a project and open the shopping list.
  2. Switch the shopping list view to a state such as Built or Missing where the visible list is empty.
  3. Click a blueprint export action, such as exporting constant combinators or requester chests.

Expected behavior

An empty visible shopping list should not crash the application. Export should either be unavailable in the UI or produce a safe empty blueprint payload.

Actual behavior

The export action can be invoked with no goods. The exporter then attempts to access the first item in an empty list and throws an out-of-range exception.

Fix

The exporter now handles empty goods lists explicitly and returns an empty blueprint in the same output format. The shopping list UI also disables export actions when the currently visible list is empty. A regression test covers empty goods export.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hcoona hcoona requested a review from DaleStan as a code owner May 9, 2026 22:08
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