Skip to content

Commit 0b10876

Browse files
committed
Fix GetDeviation presence containers issue
There is a wrong logic in place for presence containers that do have childs. although GetDeviations is a recursice func, a return was issued instead of just skipping the GetDeviations call on the LeafVariants
1 parent 381ea56 commit 0b10876

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/tree/sharedEntryAttributes.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,18 @@ func (s *sharedEntryAttributes) loadDefaults(ctx context.Context) error {
168168
}
169169

170170
func (s *sharedEntryAttributes) GetDeviations(ch chan<- *types.DeviationEntry, activeCase bool) {
171+
evalLeafvariants := true
171172
// if s is a presence container but has active childs, it should not be treated as a presence
172173
// container, hence the leafvariants should not be processed. For presence container with
173174
// childs the TypedValue.empty_val in the presence container is irrelevant.
174175
if s.schema.GetContainer().GetIsPresence() && len(s.GetChilds(DescendMethodActiveChilds)) > 0 {
175-
return
176+
evalLeafvariants = false
176177
}
177178

178-
// calculate Deviation on the LeafVariants
179-
s.leafVariants.GetDeviations(ch, activeCase)
179+
if evalLeafvariants {
180+
// calculate Deviation on the LeafVariants
181+
s.leafVariants.GetDeviations(ch, activeCase)
182+
}
180183

181184
// get all active childs
182185
activeChilds := s.GetChilds(DescendMethodActiveChilds)

0 commit comments

Comments
 (0)