From d54a2b9516aaa74f5a57a39652be737759c997fe Mon Sep 17 00:00:00 2001 From: Samuel Pizette Date: Sat, 10 Dec 2022 17:18:06 -0500 Subject: [PATCH] fixed method signature of extensions --- .../kotlin/com/willfp/eco/core/commands/CommandHelpers.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eco-api/src/main/kotlin/com/willfp/eco/core/commands/CommandHelpers.kt b/eco-api/src/main/kotlin/com/willfp/eco/core/commands/CommandHelpers.kt index c6fd11e4..bc75d37c 100644 --- a/eco-api/src/main/kotlin/com/willfp/eco/core/commands/CommandHelpers.kt +++ b/eco-api/src/main/kotlin/com/willfp/eco/core/commands/CommandHelpers.kt @@ -161,7 +161,7 @@ fun CommandBase.addSubcommand( * @return Returns the object given or throws an exception * @throws NotificationException exception thrown when null */ -fun T.notifyNull(key: String): T { +fun T?.notifyNull(key: String): T { return this ?: throw NotificationException(key) } @@ -220,8 +220,8 @@ fun Boolean.notifyFalse(key: String): Boolean { * @return Returns the player * @throws NotificationException exception thrown when invalid playerName */ -fun String.notifyPlayerRequired(key: String): Player { - return Bukkit.getPlayer(this) ?: throw NotificationException(key) +fun String?.notifyPlayerRequired(key: String): Player { + return Bukkit.getPlayer(this ?: "") ?: throw NotificationException(key) } /**