mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
DURACOM-267 improve handling of empty configuration property
(cherry picked from commit 0422b8786f
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
4b5248fe15
commit
b9e6af6758
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user