mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Fixed main menu crash (#4270)
Fixed a critical bug where the game would crash when any option was picked in the main menu. The bug was introduced by 823e6ffc2a4d14c04a661e2e0f8c2253c0d0844a.
This commit is contained in:
parent
823e6ffc2a
commit
8549931360
@ -119,7 +119,7 @@ open class Stats() {
|
|||||||
private val statRegex = Regex(statRegexPattern)
|
private val statRegex = Regex(statRegexPattern)
|
||||||
private val entireStringRegexPattern = Regex("$statRegexPattern(, $statRegexPattern)*")
|
private val entireStringRegexPattern = Regex("$statRegexPattern(, $statRegexPattern)*")
|
||||||
fun isStats(string:String): Boolean {
|
fun isStats(string:String): Boolean {
|
||||||
if (string[0] != '+' && string[0] != '-') return false // very quick negative check before the heavy Regex
|
if (string.isEmpty() || string[0] !in "+-") return false // very quick negative check before the heavy Regex
|
||||||
return entireStringRegexPattern.matches(string)
|
return entireStringRegexPattern.matches(string)
|
||||||
}
|
}
|
||||||
fun parse(string:String):Stats{
|
fun parse(string:String):Stats{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user