1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-31 10:29:10 +00:00

Fix 29ceaf0a8: checking std::optional against nullptr caused crash

This commit is contained in:
Rubidium
2025-04-27 20:21:31 +02:00
committed by rubidium42
parent 49ef3eee13
commit 794ba1f5da

View File

@@ -339,8 +339,8 @@ template <class Tbase_set> std::optional<std::string_view> TryGetBaseSetFile(con
template <class Tbase_set>
/* static */ bool BaseMedia<Tbase_set>::HasSet(const ContentInfo &ci, bool md5sum)
{
return (TryGetBaseSetFile(ci, md5sum, BaseMedia<Tbase_set>::available_sets) != nullptr) ||
(TryGetBaseSetFile(ci, md5sum, BaseMedia<Tbase_set>::duplicate_sets) != nullptr);
return TryGetBaseSetFile(ci, md5sum, BaseMedia<Tbase_set>::available_sets).has_value() ||
TryGetBaseSetFile(ci, md5sum, BaseMedia<Tbase_set>::duplicate_sets).has_value();
}
/**