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) } } }