Skip to content

Commit d7882b6

Browse files
committed
Fix crash on item frame destruction
1 parent 17a11d7 commit d7882b6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Minecraft.World/MapItemSavedData.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,14 @@ void MapItemSavedData::mergeInMapData(shared_ptr<MapItemSavedData> dataToAdd)
596596

597597
void MapItemSavedData::removeItemFrameDecoration(shared_ptr<ItemInstance> item)
598598
{
599-
AUTO_VAR(frameDecoration, nonPlayerDecorations.find( item->getFrame()->entityId ) );
599+
if ( !item )
600+
return;
601+
602+
std::shared_ptr<ItemFrame> frame = item->getFrame();
603+
if ( !frame )
604+
return;
605+
606+
auto frameDecoration = nonPlayerDecorations.find(frame->entityId);
600607
if ( frameDecoration != nonPlayerDecorations.end() )
601608
{
602609
delete frameDecoration->second;

0 commit comments

Comments
 (0)