Commit 40d49fcc authored by Thomas Huster's avatar Thomas Huster

[17232] handle unknown law for billing system in BillingSystemService

parent c647835b
Pipeline #12134 passed with stages
in 4 minutes and 42 seconds
......@@ -7,6 +7,7 @@ import java.util.Optional;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.slf4j.LoggerFactory;
import ch.elexis.core.constants.Preferences;
import ch.elexis.core.l10n.Messages;
......@@ -81,10 +82,15 @@ public class BillingSystemService implements IBillingSystemService {
if ("IVG".equals(configuredLaw)) {
configuredLaw = "IV";
}
BillingLaw law = BillingLaw.valueOf(configuredLaw);
BillingSystem billingSystem = new BillingSystem(name, law);
// TODO more attributes
return Optional.of(billingSystem);
if (configuredLaw != null) {
BillingLaw law = BillingLaw.valueOf(configuredLaw);
BillingSystem billingSystem = new BillingSystem(name, law);
// TODO more attributes
return Optional.of(billingSystem);
} else {
LoggerFactory.getLogger(getClass())
.warn("Could not determine law for billing system [" + name + "]");
}
}
return Optional.empty();
......
Markdown is supported
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