From 67a264404474c9dcbe5739f5abbde0628cf1fa18 Mon Sep 17 00:00:00 2001 From: hexagon-recursion Date: Mon, 26 Aug 2024 11:19:04 +0300 Subject: [PATCH] Fix crash --- colobot-base/src/object/task/taskbuild.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colobot-base/src/object/task/taskbuild.cpp b/colobot-base/src/object/task/taskbuild.cpp index 9c31c44f8..76b3dd26c 100644 --- a/colobot-base/src/object/task/taskbuild.cpp +++ b/colobot-base/src/object/task/taskbuild.cpp @@ -430,7 +430,7 @@ Error CTaskBuild::Start(ObjectType type) if (IsObjectCarryingCargo(m_object)) return ERR_MANIP_BUSY; CObject* metal = SearchMetalObject(oAngle, 2.0f, 100.0f, Math::PI*0.25f, err); - m_metal_id = metal->GetID(); + if ( metal ) m_metal_id = metal->GetID(); if ( err == ERR_BUILD_METALNEAR && metal != nullptr ) { err = FlatFloor();