Add test device connections utility
[openflowjava.git] / simple-client / src / main / java / org / opendaylight / openflowjava / protocol / impl / clients / WaitForMessageEvent.java
index 59228e3645a6ac4e6703f4ddd48008ab2a1963d5..f57b738f4032fa79e999d54d868f3c6dc0bab50b 100644 (file)
@@ -54,9 +54,11 @@ public class WaitForMessageEvent implements ClientEvent {
      * @param headerReceived header (first 8 bytes) of expected message
      */
     public void setHeaderReceived(byte[] headerReceived) {
-        this.headerReceived = new byte[headerReceived.length];
-        for (int i = 0; i < headerReceived.length; i++) {
-            this.headerReceived[i] = headerReceived[i];
+        if (headerReceived != null) {
+            this.headerReceived = new byte[headerReceived.length];
+            for (int i = 0; i < headerReceived.length; i++) {
+                this.headerReceived[i] = headerReceived[i];
+            }
         }
     }
 }