Commit a53cd3d1 authored by Luna Riegel's avatar Luna Riegel
Browse files

Fix: Add guard against model NPE

parent 6f4954b9
......@@ -50,6 +50,7 @@ import java.util.stream.Collectors;
import javax.annotation.Nullable;
import javax.swing.text.html.Option;
import de.hft.stuttgart.citydoctor2.database.UnconnectedCache;
import de.hft.stuttgart.citydoctor2.utils.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -487,10 +488,11 @@ public class Checker {
}
fillParameterMapsWithDefaultParameter(enabledCheck, parameterMap);
ArrayList<Check> checkList = new ArrayList<>();
CityObjectCache cache = model != null ? model.getCache() : new UnconnectedCache();
for (CheckId id : enabledCheck) {
Check c = checkConfig.getCheckForId(id);
//TODO: Change this to correct handling with streamchecker
c.init(parameterMap, parserConfig, model.getCache());
c.init(parameterMap, parserConfig, cache);
checkList.add(c);
}
return checkList;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment