From b38693bc33fadd7f244004c34cf48138e66d7ee4 Mon Sep 17 00:00:00 2001 From: Jakob K Date: Wed, 24 Mar 2021 14:20:36 +0100 Subject: [PATCH] Update BrigardierWrapper.kt --- .../main/kotlin/net/axay/fabrik/commands/BrigardierWrapper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fabrikmc-commands/src/main/kotlin/net/axay/fabrik/commands/BrigardierWrapper.kt b/fabrikmc-commands/src/main/kotlin/net/axay/fabrik/commands/BrigardierWrapper.kt index 1696423d..b0db9fbc 100644 --- a/fabrikmc-commands/src/main/kotlin/net/axay/fabrik/commands/BrigardierWrapper.kt +++ b/fabrikmc-commands/src/main/kotlin/net/axay/fabrik/commands/BrigardierWrapper.kt @@ -71,11 +71,11 @@ inline fun ArgumentBuilder.argument( * Add custom suspending suggestion logic for an argument. */ inline fun RequiredArgumentBuilder.simpleSuggests( - crossinline suggestionBuilder: suspend (CommandContext) -> Iterable + crossinline suggestionBuilder: suspend (CommandContext) -> Iterable? ) { suggests { context, builder -> fabrikCoroutineScope.async { - suggestionBuilder.invoke(context).forEach { + suggestionBuilder.invoke(context)?.forEach { if (it is Int) builder.suggest(it) else