findbugs: move assert to a place where it still makes sense

Signed-off-by: Daan Hoogland <daan@onecht.net>
This commit is contained in:
Daan Hoogland 2015-06-23 22:21:29 +02:00
parent 82ecc1aa06
commit e8984d16ed

View File

@ -127,10 +127,10 @@ public class BaremetalPxeElement extends AdapterBase implements NetworkElement {
}
VMInstanceVO vo = _vmDao.findById(vm.getId());
assert vo != null : "Where ths nic " + nic.getId() + " going???";
if (vo.getLastHostId() == null) {
nic.setMacAddress(dest.getHost().getPrivateMacAddress());
NicVO nicVo = _nicDao.findById(nic.getId());
assert vo != null : "Where ths nic " + nic.getId() + " going???";
nicVo.setMacAddress(nic.getMacAddress());
_nicDao.update(nicVo.getId(), nicVo);