To address the IllegalStateException encountered in choice processing,
an additional condition has been implemented to check if the choice has cases.
This ensures proper handling and avoids the exception.
JIRA: NETCONF-938
Change-Id: I3d1062bb5a0505944cffb1d3df1ddc80de5f7e00
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
processDataAndActionNodes(childNode, newTitle, stack, definitionNames, result, newTitle, isConfig);
}
stack.exit();
- } else if (node instanceof ChoiceSchemaNode choiceNode) {
+ } else if (node instanceof ChoiceSchemaNode choiceNode && !choiceNode.getCases().isEmpty()) {
// Process default case or first case
final var caseNode = choiceNode.getDefaultCase()
.orElseGet(() -> choiceNode.getCases().stream().findFirst()