Skip to content

Commit

Permalink
Merge pull request #50 from HQService/fix/command-argument
Browse files Browse the repository at this point in the history
fix: Double이 아닐 때 ArgumentFeedback을 throw하지 않는 문제 해결
  • Loading branch information
cccgh5 authored Mar 22, 2024
2 parents 016b74d + 61e11e8 commit b0c2f5c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.bukkit.Location
class DoubleCommandArgumentProvider : CommandArgumentProvider<Double> {
override suspend fun cast(context: CommandContext, argument: String?): Double {
argument ?: throw ArgumentFeedback.RequireArgument
return argument.toDouble()
return argument.toDoubleOrNull() ?: throw ArgumentFeedback.NotNumber
}

override suspend fun getTabComplete(context: CommandContext, location: Location?): List<String> {
Expand Down

0 comments on commit b0c2f5c

Please sign in to comment.