mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ConfigurationManagerImpl: Fix NPE when trying to access method on null object
Before checking obj.length, the fix is to check that the obj is not null Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
4a6560a9ee
commit
e3b3a18aef
@ -407,7 +407,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||||||
String mgtCidr = _configDao.getValue(Config.ManagementNetwork.key());
|
String mgtCidr = _configDao.getValue(Config.ManagementNetwork.key());
|
||||||
if (mgtCidr == null || mgtCidr.trim().isEmpty()) {
|
if (mgtCidr == null || mgtCidr.trim().isEmpty()) {
|
||||||
String[] localCidrs = NetUtils.getLocalCidrs();
|
String[] localCidrs = NetUtils.getLocalCidrs();
|
||||||
if (localCidrs.length > 0) {
|
if (localCidrs != null && (localCidrs.length > 0)) {
|
||||||
s_logger.warn("Management network CIDR is not configured originally. Set it default to " + localCidrs[0]);
|
s_logger.warn("Management network CIDR is not configured originally. Set it default to " + localCidrs[0]);
|
||||||
|
|
||||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_MANAGMENT_NODE, 0, new Long(0), "Management network CIDR is not configured originally. Set it default to "
|
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_MANAGMENT_NODE, 0, new Long(0), "Management network CIDR is not configured originally. Set it default to "
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user