mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-01 02:14:51 +07: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 823e6ffc2a
.
This commit is contained in:
parent
823e6ffc2a
commit
8549931360
@ -119,7 +119,7 @@ open class Stats() {
|
||||
private val statRegex = Regex(statRegexPattern)
|
||||
private val entireStringRegexPattern = Regex("$statRegexPattern(, $statRegexPattern)*")
|
||||
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)
|
||||
}
|
||||
fun parse(string:String):Stats{
|
||||
|
Loading…
Reference in New Issue
Block a user