mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +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
|
@Override
|
||||||
public Object getProperty(final String name) {
|
public Object getProperty(final String name) {
|
||||||
final String[] propValue = source.getStringArray(name);
|
if (source.getProperty(name) != null) {
|
||||||
if (propValue == null || propValue.length == 0) {
|
final String[] propValue = source.getStringArray(name);
|
||||||
return null;
|
if (propValue == null || propValue.length == 0) {
|
||||||
} else if (propValue.length == 1) {
|
return "";
|
||||||
return propValue[0];
|
} else if (propValue.length == 1) {
|
||||||
|
return propValue[0];
|
||||||
|
} else {
|
||||||
|
return propValue;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return propValue;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user