diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzParameters.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzParameters.java index 0db50c223..82bf200f9 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzParameters.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzParameters.java @@ -139,7 +139,11 @@ public String getName() { } public ParametersSet getModelParameters(String parameterSetId) { - return modelsParameters.get(parameterSetId); + ParametersSet parametersSet = modelsParameters.get(parameterSetId); + if (parametersSet == null) { + throw new PowsyblException("Model parameter set " + parameterSetId + " not found"); + } + return parametersSet; } @JsonGetter("modelsParameters")