Skip to content

Commit d99fbd8

Browse files
committed
Fix equalsPlaceholderText for when only one of the strings is empty
1 parent 0ddd421 commit d99fbd8

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

Diff for: core/src/com/unciv/models/ruleset/unique/Countables.kt

-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ enum class Countables(
202202
errors.add("`$text` contains parameter `$actualParameterText` which is invalid for type `${parameterType.name}`")
203203
}
204204
return errors
205-
206205
}
207206

208207

Diff for: core/src/com/unciv/models/translations/Translations.kt

+1
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ fun String.getPlaceholderText(): String {
502502

503503
fun String.equalsPlaceholderText(str: String): Boolean {
504504
if (isEmpty() && str.isEmpty()) return true // Empty strings have no .first()
505+
if (isEmpty() != str.isEmpty()) return false
505506
if (first() != str.first()) return false // for quick negative return 95% of the time
506507
return this.getPlaceholderText() == str
507508
}

0 commit comments

Comments
 (0)