mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
fix(common): prevent crashing when parsing comment trees
Fixes COMPOSE-LOBSTERS-1Z
This commit is contained in:
parent
1a525d6e5d
commit
6226c3b0c8
1 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ internal data class CommentNode(
|
|||
child.parent = this
|
||||
} else {
|
||||
child.indentLevel += 1
|
||||
children.last().addChild(child)
|
||||
children.lastOrNull()?.addChild(child)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ internal fun createListNode(
|
|||
)
|
||||
)
|
||||
} else {
|
||||
commentNodes.last().let {
|
||||
commentNodes.lastOrNull()?.let {
|
||||
it.addChild(
|
||||
CommentNode(
|
||||
comment = comments[i],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue