Make sure the component resolves to a UPConfig before cloning it

Closes #26308
This commit is contained in:
Pedro Igor 2024-01-18 13:04:17 -03:00 committed by Marek Posolda
parent 70b4c6bf52
commit 62020ffc68

View file

@ -201,8 +201,13 @@ public class DeclarativeUserProfileProvider implements UserProfileProvider {
Optional<ComponentModel> component = getComponentModel();
if (component.isPresent()) {
UPConfig cfg = getConfigFromComponentModel(component.get()).clone();
return cfg == null ? parsedDefaultRawConfig.clone() : cfg;
UPConfig cfg = getConfigFromComponentModel(component.get());
if (cfg == null) {
cfg = parsedDefaultRawConfig;
}
return cfg.clone();
}
return parsedDefaultRawConfig.clone();