DURACOM-267 improve handling of empty configuration property

(cherry picked from commit 0422b8786f)
This commit is contained in:
Andrea Bollini
2024-05-31 19:47:12 +02:00
committed by github-actions[bot]
parent 4b5248fe15
commit b9e6af6758

View File

@@ -41,13 +41,17 @@ public class DSpaceConfigurationPropertySource extends EnumerablePropertySource<
@Override
public Object getProperty(final String name) {
final String[] propValue = source.getStringArray(name);
if (propValue == null || propValue.length == 0) {
return null;
} else if (propValue.length == 1) {
return propValue[0];
if (source.getProperty(name) != null) {
final String[] propValue = source.getStringArray(name);
if (propValue == null || propValue.length == 0) {
return "";
} else if (propValue.length == 1) {
return propValue[0];
} else {
return propValue;
}
} else {
return propValue;
return null;
}
}