From eb34e17d80ba60a7a110f79bf81a95a2b671b0c2 Mon Sep 17 00:00:00 2001 From: ceikry Date: Mon, 19 Jul 2021 17:00:42 -0500 Subject: [PATCH] bugfix for ScriptApi --- Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt b/Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt index f72db6062..b0fe0f876 100644 --- a/Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt +++ b/Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt @@ -71,7 +71,7 @@ class ScriptAPI(private val bot: Player) { is Item -> InteractionListener.ITEM else -> -1 } - val opt: Option? = node.interaction.options.filter { it.name.equals(option, true) }.firstOrNull() + val opt: Option? = node.interaction.options.filter {it != null && it.name.equals(option, true) }.firstOrNull() if(opt == null){ SystemLogger.logWarn("Invalid option name provided: $option")