commit | aab2dae0e4c01caf82675a8fd9b9eae1f28e9e27 | [log] [tgz] |
---|---|---|
author | Andrea Campanella <andrea@opennetworking.org> | Thu Mar 17 16:01:12 2022 +0100 |
committer | Andrea Campanella <andrea@opennetworking.org> | Thu Mar 17 16:01:12 2022 +0100 |
tree | 8618c88504c4453cf71555fa400b1b6b96e5a12f | |
parent | a2b65d76ef5c172fec4df73c1954449faf9467af [diff] |
Avoid NPE for absent option82 in DHCP packet Change-Id: I8ebcecab07533f3e82787d78b9b98369e39c6161
diff --git a/app/src/main/java/org/opencord/dhcpl2relay/impl/DhcpL2Relay.java b/app/src/main/java/org/opencord/dhcpl2relay/impl/DhcpL2Relay.java index a426035..1996227 100755 --- a/app/src/main/java/org/opencord/dhcpl2relay/impl/DhcpL2Relay.java +++ b/app/src/main/java/org/opencord/dhcpl2relay/impl/DhcpL2Relay.java
@@ -889,7 +889,7 @@ if (opt != null && opt instanceof DhcpRelayAgentOption) { DhcpRelayAgentOption d82 = (DhcpRelayAgentOption) opt; DhcpOption d82ckt = d82.getSubOption(DhcpOption82Data.CIRCUIT_ID_CODE); - if (d82ckt.getData() != null) { + if (d82ckt != null && d82ckt.getData() != null) { r2cData = decodeCircuitId(new String(d82ckt.getData())); } }