We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e742bd1 + c9d71ce commit 262e4d4Copy full SHA for 262e4d4
code/parse/sexp/LuaSEXP.cpp
@@ -174,8 +174,9 @@ luacpp::LuaValue LuaSEXP::sexpToLua(int node, int argnum) const {
174
auto ship_entry = eval_ship(node);
175
176
// if this is a shipname type, we want the name of a valid ship but not the ship itself
177
- if (ship_entry && argtype.first == "shipname") {
178
- return LuaValue::createValue(_action.getLuaState(), ship_entry->name);
+ // (if the ship is not valid, return an empty string)
+ if (argtype.first == "shipname") {
179
+ return LuaValue::createValue(_action.getLuaState(), ship_entry ? ship_entry->name : "");
180
}
181
182
if (!ship_entry || ship_entry->status != ShipStatus::PRESENT) {
0 commit comments