From 88f5a3b56c1b5ccfe3a7858d138d420bba55a542 Mon Sep 17 00:00:00 2001 From: phinner <62483793+phinner@users.noreply.github.com> Date: Mon, 29 Apr 2024 05:39:13 +0200 Subject: [PATCH] fix: Fix NPE in building lifecycle events --- .../com/xpdustry/nohorny/extension/MindustryExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/xpdustry/nohorny/extension/MindustryExtensions.kt b/src/main/kotlin/com/xpdustry/nohorny/extension/MindustryExtensions.kt index 22234af..1354f25 100644 --- a/src/main/kotlin/com/xpdustry/nohorny/extension/MindustryExtensions.kt +++ b/src/main/kotlin/com/xpdustry/nohorny/extension/MindustryExtensions.kt @@ -55,7 +55,7 @@ internal inline fun onBuildingLifecycleEvent( for (building in buildings) { if (building is T) { - insert(building, event.unit.player) + insert(building, event.unit?.player) } } }