the port in action field is optional for qos flow rule

Change-Id: Ia590bcb94b20f917ad12b02d6c68da56aea0a233
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java b/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
index f523430..5393eef 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
@@ -301,7 +301,9 @@
                 final Instructions.SetQueueInstruction setQueueInstruction =
                         (Instructions.SetQueueInstruction) instruction;
                 result.put(InstructionCodec.QUEUE_ID, setQueueInstruction.queueId());
-                result.put(InstructionCodec.PORT, setQueueInstruction.port().toString());
+                if (setQueueInstruction.port() != null) {
+                    result.put(InstructionCodec.PORT, setQueueInstruction.port().toString());
+                }
                 break;
 
             case L0MODIFICATION: