avoid segfault when returning list of fixes by style

This commit is contained in:
Axel Kohlmeyer
2023-04-02 20:09:25 -04:00
parent 09deafd6d4
commit 19683ade92

View File

@ -1113,7 +1113,7 @@ const std::vector<Fix *> Modify::get_fix_by_style(const std::string &style) cons
if (style.empty()) return matches;
for (int ifix = 0; ifix < nfix; ifix++)
if (utils::strmatch(fix[ifix]->style, style)) matches.push_back(fix[ifix]);
if (fix[ifix] && utils::strmatch(fix[ifix]->style, style)) matches.push_back(fix[ifix]);
return matches;
}