Skip to content

Commit b81e9c9

Browse files
author
GabrielBrascher
committed
Prevent NullPointer on a network with removed IP ranges/"VLANs"
java.lang.NullPointerException at com.cloud.network.NetworkModelImpl.getPlaceholderNicForRouter(NetworkModelImpl.java:2306)
1 parent 38f97c6 commit b81e9c9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

engine/schema/src/main/java/com/cloud/dc/dao/VlanDaoImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ public List<VlanVO> listVlansForPod(long podId) {
167167
List<PodVlanMapVO> vlanMaps = _podVlanMapDao.listPodVlanMapsByPod(podId);
168168
List<VlanVO> result = new ArrayList<VlanVO>();
169169
for (PodVlanMapVO pvmvo : vlanMaps) {
170-
result.add(findById(pvmvo.getVlanDbId()));
170+
VlanVO vlanByPodId = findById(pvmvo.getVlanDbId());
171+
if (vlanByPodId != null && vlanByPodId.getRemoved() == null) {
172+
result.add(vlanByPodId);
173+
}
171174
}
172175
return result;
173176
}

0 commit comments

Comments
 (0)