diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-03 09:27:28 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-03 09:27:28 +0700 |
| commit | d7882b68a428906a4f063d40432012a560b5921f (patch) | |
| tree | 08832ece0c8f88dfe1d2dfc5728f59423646c0dc /Minecraft.World | |
| parent | 17a11d7913f971249fa52bcd37fd0cc5b03fdc04 (diff) | |
Fix crash on item frame destruction
Diffstat (limited to 'Minecraft.World')
| -rw-r--r-- | Minecraft.World/MapItemSavedData.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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<MapItemSavedData> dataToAdd) void MapItemSavedData::removeItemFrameDecoration(shared_ptr<ItemInstance> item) { - AUTO_VAR(frameDecoration, nonPlayerDecorations.find( item->getFrame()->entityId ) ); + if ( !item ) + return; + + std::shared_ptr<ItemFrame> frame = item->getFrame(); + if ( !frame ) + return; + + auto frameDecoration = nonPlayerDecorations.find(frame->entityId); if ( frameDecoration != nonPlayerDecorations.end() ) { delete frameDecoration->second; |
