Skip to content

Commit

Permalink
Detect the case of a null guid or name in InsertOrKeepVessel.
Browse files Browse the repository at this point in the history
  • Loading branch information
pleroy committed Jun 18, 2024
1 parent 59e4f4b commit 1db8f95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ksp_plugin/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,12 @@ void __cdecl principia__InsertOrKeepVessel(Plugin* const plugin,
journal::Method<journal::InsertOrKeepVessel> m(
{plugin, vessel_guid, vessel_name, parent_index, loaded}, {inserted});
CHECK_NOTNULL(plugin);
CHECK(vessel_guid != nullptr)
<< "name: "
<< (vessel_name == nullptr ? "null" : std::string_view(vessel_name));
CHECK(vessel_name != nullptr)
<< "guid: "
<< (vessel_guid == nullptr ? "null" : std::string_view(vessel_guid));
plugin->InsertOrKeepVessel(vessel_guid,
vessel_name,
parent_index,
Expand Down

0 comments on commit 1db8f95

Please sign in to comment.