From 1adf024ab66db16b7e85ad22b6aabf512ecb835f Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sat, 13 Dec 2025 21:07:05 +0200 Subject: [PATCH] Fix possible uncaught exception on deleting object with no deleter set --- lib/rmg/modificators/TreasurePlacer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rmg/modificators/TreasurePlacer.cpp b/lib/rmg/modificators/TreasurePlacer.cpp index b527433bc..a597165df 100644 --- a/lib/rmg/modificators/TreasurePlacer.cpp +++ b/lib/rmg/modificators/TreasurePlacer.cpp @@ -752,7 +752,8 @@ rmg::Object TreasurePlacer::constructTreasurePile(const std::vector if(oi->templates.empty()) { logGlobal->warn("Deleting randomized object with no templates: %s", object->getObjectName()); - oi->destroyObject(*object); + if (oi->destroyObject) + oi->destroyObject(*object); continue; } }