From 6fd35be67ac4195d5c976693a71ba2ad9998666a Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Fri, 9 Oct 2020 22:12:19 +0200 Subject: [PATCH] added check if the digger is a nullptr (#4981) Co-authored-by: 12xx12 <12xx12100@gmail.com> --- src/Blocks/BlockIce.h | 1 + src/Blocks/BlockMobSpawner.h | 4 ++++ src/Blocks/BlockOre.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/Blocks/BlockIce.h b/src/Blocks/BlockIce.h index 8ff6415fb..76b48d04f 100644 --- a/src/Blocks/BlockIce.h +++ b/src/Blocks/BlockIce.h @@ -85,6 +85,7 @@ private: const cEntity * a_Digger ) const override { + UNUSED(a_Digger); // If there's a solid block or a liquid underneath, convert to water, rather than air if (a_BlockPos.y <= 0) { diff --git a/src/Blocks/BlockMobSpawner.h b/src/Blocks/BlockMobSpawner.h index 27d3d61de..791a71301 100644 --- a/src/Blocks/BlockMobSpawner.h +++ b/src/Blocks/BlockMobSpawner.h @@ -61,6 +61,10 @@ private: const cEntity * a_Digger ) const override { + if (a_Digger == nullptr) + { + return; + } if (!a_Digger->IsPlayer()) { return; diff --git a/src/Blocks/BlockOre.h b/src/Blocks/BlockOre.h index 6d6c2a097..db4f4aea4 100644 --- a/src/Blocks/BlockOre.h +++ b/src/Blocks/BlockOre.h @@ -71,6 +71,10 @@ private: const cEntity * a_Digger ) const override { + if (a_Digger == nullptr) + { + return; + } if (!a_Digger->IsPlayer()) { return;