Skip to content

Commit

Permalink
MCR-3332 fix getParameter method of MCRParameterCollector
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhofmann committed Feb 21, 2025
1 parent 3c2a031 commit 2072ba4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down Expand Up @@ -186,8 +187,10 @@ private void setXSLParameter(String name, String value) {
* Returns the parameter with the given name
*/
public String getParameter(String name, String defaultValue) {
Object val = parameters.get(name);
return (val == null) ? defaultValue : val.toString();
return Optional.ofNullable(parameters.get(name))
.map(Object::toString)
.or(() -> Optional.ofNullable(SavePropertiesCacheHolder.getSafePropertiesCache().get(name)))
.orElse(defaultValue);
}

/**
Expand Down

0 comments on commit 2072ba4

Please sign in to comment.