1
0
Fork 0

For #5656: Fixes nightly major version number crash

master
Sawyer Blatz 2019-09-27 14:19:14 -07:00 committed by Emily Kager
parent a38b73f19e
commit 3e42114190
1 changed files with 3 additions and 1 deletions

View File

@ -27,8 +27,10 @@ open class WhatsNewVersion(internal open val version: String) {
return false
}
// Splitting on a dot to get the major version number fails on nightly builds, so we
// return 0 in those cases
val majorVersionNumber: Int
get() = version.split(".").first().toInt()
get() = version.split(".").first().toIntOrNull() ?: 0
}
data class ContextWhatsNewVersion(private val context: Context) : WhatsNewVersion("") {