CID-1116300 Prevent potential NPE

This commit is contained in:
Hugo Trippaers 2014-09-19 11:55:17 +02:00
parent 6f54d48772
commit 90df7cf881
1 changed files with 4 additions and 0 deletions

View File

@ -122,6 +122,10 @@ public abstract class ServerResourceBase implements ServerResource {
}
}
String infos[] = NetUtils.getNetworkParams(_privateNic);
if (infos == null) {
s_logger.warn("Incorrect details for private Nic during initialization of ServerResourceBase");
return false;
}
params.put("host.ip", infos[0]);
params.put("host.mac.address", infos[1]);