Skip to content

Commit

Permalink
Merge pull request #629 from nuclearkatie/source_packaging
Browse files Browse the repository at this point in the history
Source prevent seg fault due to packaging failure
  • Loading branch information
gonuke authored Sep 24, 2024
2 parents b040cdf + a74aa8a commit 6dc5ecb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Since last release
**Fixed:**

* Schedule Decommission in ``Reactor::Tick()`` instead of Decommission (#609)
* When trades fail in Source due to packaging, send empty material instead of seg faulting (#629)

**Removed:**

Expand Down
3 changes: 3 additions & 0 deletions src/source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ void Source::GetMatlTrades(
// package in it. This single packaged resource is our response
response = m_pkgd[0];
shippable_trades -= 1;
} else {
// If packaging failed, respond with a zero (empty) material
response = Material::CreateUntracked(0, m->comp());
}

if (outrecipe.empty() && response->comp() != it->request->target()->comp()) {
Expand Down

0 comments on commit 6dc5ecb

Please sign in to comment.