Skip to content

Commit e980710

Browse files
Fixed bug; new version
1 parent cb800f8 commit e980710

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group "de.randombyte"
9-
version "2.1"
9+
version "2.1.5"
1010

1111
repositories {
1212
jcenter()

src/main/kotlin/de/randombyte/commandutils/CommandUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CommandUtils @Inject constructor(
5252
companion object {
5353
const val ID = "command-utils"
5454
const val NAME = "CommandUtils"
55-
const val VERSION = "2.0.5"
55+
const val VERSION = "2.1.5"
5656
const val AUTHOR = "RandomByte"
5757

5858
const val PLACEHOLDER_API_ID = "placeholderapi"

src/main/kotlin/de/randombyte/commandutils/utils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ private fun String.tryProcessPlaceholders(placeholderApi: PlaceholderService?, c
5555
val placeholders = placeholderApi.defaultPattern.toRegex()
5656
.findAll(this)
5757
.map { matchResult -> matchResult.groupValues[1] }.toList()
58-
val replacements = placeholders.map { placeholder ->
59-
val replacement = placeholderApi.parse(placeholder, commandSource, null)
58+
val replacements = placeholders.mapNotNull { placeholder ->
59+
val replacement = placeholderApi.parse(placeholder, commandSource, null) ?: return@mapNotNull null
6060
val replacementString = if (replacement is Text) {
6161
TextSerializers.FORMATTING_CODE.serialize(replacement)
6262
} else {

0 commit comments

Comments
 (0)