From 94e7cfc211d6f938f20315eff028fde194a13f29 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Wed, 1 Jan 2025 02:07:44 -0800 Subject: [PATCH] fix optional (#1707) --- dDatabase/GameDatabase/MySQL/Tables/Property.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dDatabase/GameDatabase/MySQL/Tables/Property.cpp b/dDatabase/GameDatabase/MySQL/Tables/Property.cpp index 8aaf93c4..bf372874 100644 --- a/dDatabase/GameDatabase/MySQL/Tables/Property.cpp +++ b/dDatabase/GameDatabase/MySQL/Tables/Property.cpp @@ -56,6 +56,7 @@ std::optional MySQLDatabase::GetProperties(co params.playerId ); if (count->next()) { + if (!result) result = IProperty::PropertyEntranceResult(); result->totalEntriesMatchingQuery = count->getUInt("count"); } } else { @@ -109,11 +110,13 @@ std::optional MySQLDatabase::GetProperties(co params.playerSort ); if (count->next()) { + if (!result) result = IProperty::PropertyEntranceResult(); result->totalEntriesMatchingQuery = count->getUInt("count"); } } while (properties->next()) { + if (!result) result = IProperty::PropertyEntranceResult(); auto& entry = result->entries.emplace_back(); entry.id = properties->getUInt64("id"); entry.ownerId = properties->getUInt64("owner_id");