Committed by
Gerrit Code Review
ConfigProvider: Protect against potential NPE when reading files
Change-Id: Id9174ddf16fb02a19b987eb428bc68ee43139165
Showing
1 changed file
with
3 additions
and
0 deletions
... | @@ -278,6 +278,9 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { | ... | @@ -278,6 +278,9 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { |
278 | } | 278 | } |
279 | 279 | ||
280 | private void updatePorts(ConnectPoint src, ConnectPoint dst, SparseAnnotations annotations) { | 280 | private void updatePorts(ConnectPoint src, ConnectPoint dst, SparseAnnotations annotations) { |
281 | + if (annotations == null) { | ||
282 | + return; | ||
283 | + } | ||
281 | final String linkType = annotations.value("optical.type"); | 284 | final String linkType = annotations.value("optical.type"); |
282 | if ("cross-connect".equals(linkType)) { | 285 | if ("cross-connect".equals(linkType)) { |
283 | String value = annotations.value("bandwidth").trim(); | 286 | String value = annotations.value("bandwidth").trim(); | ... | ... |
-
Please register or login to post a comment