summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemMinecart.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Items/ItemMinecart.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Items/ItemMinecart.h b/src/Items/ItemMinecart.h
index 6344c0178..623342d41 100644
--- a/src/Items/ItemMinecart.h
+++ b/src/Items/ItemMinecart.h
@@ -73,7 +73,12 @@ public:
return false;
}
} // switch (m_ItemType)
- Minecart->Initialize(*a_World);
+ if (!Minecart->Initialize(*a_World))
+ {
+ delete Minecart;
+ Minecart = nullptr;
+ return false;
+ }
if (!a_Player->IsGameModeCreative())
{