avoid crash with bad xml format (#551)
This commit is contained in:
parent
6d6fb8da77
commit
05a52f2e13
1 changed files with 11 additions and 7 deletions
|
|
@ -61,13 +61,17 @@ fun WhatsNewDialog(onDismissRequest: () -> Unit) {
|
||||||
Column {
|
Column {
|
||||||
val changelog by produceState<List<DisplayChangelog>?>(initialValue = null) {
|
val changelog by produceState<List<DisplayChangelog>?>(initialValue = null) {
|
||||||
value = withIOContext {
|
value = withIOContext {
|
||||||
XML.decodeFromReader<Changelog>(
|
try {
|
||||||
AndroidXmlReader(
|
XML.decodeFromReader<Changelog>(
|
||||||
context.resources.openRawResource(
|
AndroidXmlReader(
|
||||||
if (isReleaseBuildType) R.raw.changelog_release else R.raw.changelog_preview,
|
context.resources.openRawResource(
|
||||||
).bufferedReader(),
|
if (isReleaseBuildType) R.raw.changelog_release else R.raw.changelog_preview,
|
||||||
),
|
).bufferedReader(),
|
||||||
).toDisplayChangelog()
|
),
|
||||||
|
).toDisplayChangelog()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
emptyList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (changelog != null) {
|
if (changelog != null) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue