Skip to content

Commit ef2e32f

Browse files
Add validation check for non-empty operations in mergeOperations of Parser.kt.
1 parent 177b462 commit ef2e32f

File tree

1 file changed

+1
-0
lines changed
  • core/common/src/internal/format/parser

1 file changed

+1
-0
lines changed

core/common/src/internal/format/parser/Parser.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ internal fun <T> List<ParserStructure<T>>.concat(): ParserStructure<T> {
7171
unconditionalModifications: List<UnconditionalModification<T>>,
7272
simplifiedParserStructure: ParserStructure<T>,
7373
): ParserStructure<T> {
74+
require(simplifiedParserStructure.operations.isNotEmpty()) { "Cannot merge operations from empty structure" }
7475
val operationsToMerge = simplifiedParserStructure.operations
7576
val firstOperation = operationsToMerge.firstOrNull()
7677
val mergedOperations = buildList {

0 commit comments

Comments
 (0)