]> git.tdb.fi Git - poefilter.git/blobdiff - source/category.cpp
Check for and prune non-viable branches in the condition tree
[poefilter.git] / source / category.cpp
index 5e454bb9dc7af7dcef5843efa9b4a3b96761404c..0f6eb3f57e962ab0021b7b238aabff1a2470b571 100644 (file)
@@ -49,8 +49,12 @@ void Category::create_statements(list<FilterStatement> &st) const
        if(condition)
        {
                Condition *flat = condition->flatten();
-               flat->add_lines(st);
-               delete flat;
+               if(flat)
+               {
+                       flat->add_lines(st);
+                       delete flat;
+               }
+               // TODO handle the case of the entire condition being non-viable
        }
 }