From bc9d4cdc21e0707acff1a9e99927735964b4880e Mon Sep 17 00:00:00 2001
From: Moritz Meyerhof <moritz.meyerhof@rub.de>
Date: Wed, 14 Apr 2021 15:13:58 +0200
Subject: [PATCH] Fixed Spawning without Mana

---
 Assets/Scripts/Store/EnemySpawnController.cs | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Assets/Scripts/Store/EnemySpawnController.cs b/Assets/Scripts/Store/EnemySpawnController.cs
index b1c34b2..388b868 100644
--- a/Assets/Scripts/Store/EnemySpawnController.cs
+++ b/Assets/Scripts/Store/EnemySpawnController.cs
@@ -92,8 +92,11 @@ public class EnemySpawnController : MonoBehaviour
 
     public void OnEnemyDrop()
     {
-        Destroy(enemyImage);
-        enemyImage = null;
-        Instantiate(activeSpawn.enemyPrefab, PositionPrefab(), Quaternion.identity);
+        if (enemyImage != null)
+        {
+            Destroy(enemyImage);
+            enemyImage = null;
+            Instantiate(activeSpawn.enemyPrefab, PositionPrefab(), Quaternion.identity);
+        }
     }
 }
-- 
GitLab