diff --git a/lib/JsonNode.cpp b/lib/JsonNode.cpp index 41edb62ab..bae2f077c 100644 --- a/lib/JsonNode.cpp +++ b/lib/JsonNode.cpp @@ -829,7 +829,13 @@ std::shared_ptr JsonUtils::parseBonus(const JsonNode &ability) auto b = std::make_shared(); if (!parseBonus(ability, b.get())) { - return nullptr; + // caller code can not handle this case and presumes that returned bonus is always valid + logGlobal->error("Failed to parse bonus! Json config was %S ", ability.toJson()); + + b->type = BonusType::NONE; + assert(0); // or throw? Game *should* work with dummy bonus + + return b; } return b; }