You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2017/09/01 11:13:42 UTC
[cloudstack] branch master updated: CLOUDSTACK-10058: Error while
opening the Settings tab in Secondary storage (#2254)
This is an automated email from the ASF dual-hosted git repository.
bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push:
new a52ce36 CLOUDSTACK-10058: Error while opening the Settings tab in Secondary storage (#2254)
a52ce36 is described below
commit a52ce3628c7121618573a5137c358bdfdc5a229b
Author: Nitin Kumar Maharana <ni...@accelerite.com>
AuthorDate: Fri Sep 1 16:43:39 2017 +0530
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.
---
.../config/src/org/apache/cloudstack/framework/config/ConfigKey.java | 3 ++-
server/src/com/cloud/server/ManagementServerImpl.java | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/ConfigKey.java b/framework/config/src/org/apache/cloudstack/framework/config/ConfigKey.java
index 4a41306..fb2a57b 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/ConfigKey.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/ConfigKey.java
@@ -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;
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 79bc3d5..b135b4e 100644
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -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);
--
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <co...@cloudstack.apache.org>'].