From d7882b68a428906a4f063d40432012a560b5921f Mon Sep 17 00:00:00 2001 From: void_17 Date: Tue, 3 Mar 2026 09:27:28 +0700 Subject: [PATCH] Fix crash on item frame destruction --- Minecraft.World/MapItemSavedData.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Minecraft.World/MapItemSavedData.cpp b/Minecraft.World/MapItemSavedData.cpp index 6304aa62..981bab3e 100644 --- a/Minecraft.World/MapItemSavedData.cpp +++ b/Minecraft.World/MapItemSavedData.cpp @@ -596,7 +596,14 @@ void MapItemSavedData::mergeInMapData(shared_ptr dataToAdd) void MapItemSavedData::removeItemFrameDecoration(shared_ptr item) { - AUTO_VAR(frameDecoration, nonPlayerDecorations.find( item->getFrame()->entityId ) ); + if ( !item ) + return; + + std::shared_ptr frame = item->getFrame(); + if ( !frame ) + return; + + auto frameDecoration = nonPlayerDecorations.find(frame->entityId); if ( frameDecoration != nonPlayerDecorations.end() ) { delete frameDecoration->second;