fix cnfvar crash on end inside child vars
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Tue, 24 Jul 2018 13:46:54 +0000 (15:46 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Mon, 5 Nov 2018 11:16:39 +0000 (12:16 +0100)
The recursive call to parse_cnf_children() may also return None
if it hit EOF.

src/cnfvar.py

index 7ab5d93..483a96f 100644 (file)
@@ -485,6 +485,8 @@ def parse_cnf_children(state, parent):
                 # parent is further down in hierarchy -> new level
                 (state, children, new_parent) = \
                     parse_cnf_children (state, new_parent)
+                if state is None:
+                    break
                 cnf_line["children"] = children
                 current = get(state)
                 new_parent = get_parent(current)