Skip to content

Commit 2e29c89

Browse files
Default null value in ConfigKey results in NPE on second start
1 parent 13e7a73 commit 2e29c89

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
import javax.inject.Inject;
2626

2727
import org.apache.log4j.Logger;
28-
2928
import org.apache.cloudstack.framework.config.ConfigDepot;
3029
import org.apache.cloudstack.framework.config.ConfigDepotAdmin;
3130
import org.apache.cloudstack.framework.config.ConfigKey;
3231
import org.apache.cloudstack.framework.config.Configurable;
3332
import org.apache.cloudstack.framework.config.ScopedConfigStorage;
3433
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
34+
import org.apache.commons.lang.ObjectUtils;
3535

3636
import com.cloud.utils.Pair;
3737
import com.cloud.utils.component.SystemIntegrityChecker;
@@ -97,10 +97,8 @@ public void populateConfigurations() {
9797
_configDao.persist(vo);
9898
} else {
9999
if (vo.isDynamic() != key.isDynamic() ||
100-
!vo.getDescription().equals(key.description()) ||
101-
((vo.getDefaultValue() != null && key.defaultValue() == null) ||
102-
(vo.getDefaultValue() == null && key.defaultValue() != null) ||
103-
!vo.getDefaultValue().equals(key.defaultValue()))) {
100+
!ObjectUtils.equals(vo.getDescription(), vo.getDescription()) ||
101+
!ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue())) {
104102
vo.setDynamic(key.isDynamic());
105103
vo.setDescription(key.description());
106104
vo.setDefaultValue(key.defaultValue());

0 commit comments

Comments
 (0)