Skip to content
Snippets Groups Projects
Commit feb156bd authored by ilor's avatar ilor
Browse files

avoid erroring when there are norules of some type in wccl-rules

parent b1e4d384
No related branches found
No related tags found
No related merge requests found
......@@ -92,10 +92,15 @@ std::pair<int,int> RuleRunner::load_more_rules(const std::string& filename)
if (parsed_file) {
boost::filesystem::path p(filename);
file_names_.push_back(p.stem());
size_t match_rules = parsed_file->get_match_rules().size();
size_t tag_rules = parsed_file->get_tag_rules().size();
total_match_rules_ += match_rules;
size_t match_rules = 0, tag_rules = 0;
if (parsed_file->has_tag_rules()) {
tag_rules = parsed_file->get_tag_rules().size();
}
if (parsed_file->has_match_rules()) {
match_rules = parsed_file->get_match_rules().size();
}
total_tag_rules_ += tag_rules;
total_match_rules_ += match_rules;
parsed_files_.push_back(parsed_file);
return std::make_pair(tag_rules, match_rules);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment