mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 04:07:03 +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
|
child.parent = this
|
||||||
} else {
|
} else {
|
||||||
child.indentLevel += 1
|
child.indentLevel += 1
|
||||||
children.last().addChild(child)
|
children.lastOrNull()?.addChild(child)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ internal fun createListNode(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
commentNodes.last().let {
|
commentNodes.lastOrNull()?.let {
|
||||||
it.addChild(
|
it.addChild(
|
||||||
CommentNode(
|
CommentNode(
|
||||||
comment = comments[i],
|
comment = comments[i],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue