Fixed FakeMsg not handling nulls properly, due to me not unders. Kotlin

This commit is contained in:
Bella 2020-05-05 10:28:45 -04:00
parent d8560a92ce
commit c57761c526
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3
1 changed files with 3 additions and 3 deletions

View File

@ -11,14 +11,14 @@ import me.zeroeightsix.kami.util.MessageSendHelper
* @author dominikaaaa
*/
class FakeMessageCommand : Command("fakemsg", ChunkBuilder().append("message").build()) {
override fun call(args: Array<String>) {
override fun call(args: Array<out String?>) {
when {
args[1] != null -> { /* This is null if there is a second argument. */
args[1] != null -> {
MessageSendHelper.sendErrorMessage(chatLabel + "You must send your entire message inside \"double quotes\". Use &7&&f to add colours.")
return
}
}
MessageSendHelper.sendRawChatMessage(getTime() + args[0].replace('&', KamiMod.colour))
MessageSendHelper.sendRawChatMessage(getTime() + args[0]?.replace('&', KamiMod.colour))
}
private fun getTime(): String? {