Bug-731: fixed segment-routing sonar issues.
[bgpcep.git] / pcep / segment-routing / src / main / java / org / opendaylight / protocol / pcep / lsp / setup / type01 / CInitiated00SrpObjectWithPstTlvParser.java
index ef7136bb3cefc66e033c85297a6bd54d81652a0e..f89bb4995672a0b5ae4db869e4f9cdbac832ffbd 100644 (file)
@@ -33,11 +33,9 @@ public class CInitiated00SrpObjectWithPstTlvParser extends CInitiated00SrpObject
         super.addTlv(builder, tlv);
         final Tlvs7Builder tlvBuilder = new Tlvs7Builder();
         if (builder.getTlvs() != null) {
-            if (builder.getTlvs().getAugmentation(Tlvs7.class) != null) {
-                final Tlvs7 t = builder.getTlvs().getAugmentation(Tlvs7.class);
-                if (t.getPathSetupType() != null) {
-                    tlvBuilder.setPathSetupType(t.getPathSetupType());
-                }
+            final Tlvs7 tlvs = builder.getTlvs().getAugmentation(Tlvs7.class);
+            if (tlvs != null && tlvs.getPathSetupType() != null) {
+                tlvBuilder.setPathSetupType(tlvs.getPathSetupType());
             }
         }
         if (tlv instanceof PathSetupType) {