mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-10058: Error while opening the Settings tab in Secondary storage (#2254)
Root Cause: Some global parameters contains NULL value, where the code doesn't handle NULL check. So it fails with an exception. Hence nothing appears on the field(ERROR). Solution: Added required NULL check.
This commit is contained in:
parent
4dd8b5d061
commit
a52ce3628c
|
|
@ -140,7 +140,8 @@ public class ConfigKey<T> {
|
|||
public T value() {
|
||||
if (_value == null || isDynamic()) {
|
||||
ConfigurationVO vo = s_depot != null ? s_depot.global().findById(key()) : null;
|
||||
_value = valueOf((vo != null && vo.getValue() != null) ? vo.getValue() : defaultValue());
|
||||
final String value = (vo != null && vo.getValue() != null) ? vo.getValue() : defaultValue();
|
||||
_value = ((value == null) ? (T)defaultValue() : valueOf(value));
|
||||
}
|
||||
|
||||
return _value;
|
||||
|
|
|
|||
|
|
@ -1754,7 +1754,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
|||
if (configVo != null) {
|
||||
final ConfigKey<?> key = _configDepot.get(param.getName());
|
||||
if (key != null) {
|
||||
configVo.setValue(key.valueIn(id).toString());
|
||||
configVo.setValue(key.valueIn(id) == null ? null : key.valueIn(id).toString());
|
||||
configVOList.add(configVo);
|
||||
} else {
|
||||
s_logger.warn("ConfigDepot could not find parameter " + param.getName() + " for scope " + scope);
|
||||
|
|
|
|||
Loading…
Reference in New Issue