fix for BUG 782 - NPE in ErrorTranslator during handshake 13/6513/1 topic/threading
authorMichal Rehak <mirehak@cisco.com>
Mon, 28 Apr 2014 09:38:39 +0000 (11:38 +0200)
committerMichal Rehak <mirehak@cisco.com>
Mon, 28 Apr 2014 09:49:53 +0000 (11:49 +0200)
- there is no session available before registration

Signed-off-by: Michal Rehak <mirehak@cisco.com>
Change-Id: Ib0e420a879c6512e5f86003ad9d024aee789c04d

openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/translator/AbstractErrorTranslator.java

index b71da457032f6e3f4a13bbc79ac066e0bb63e0d5..139656a13a20c606b90b357a849f8d688d0dcbe7 100644 (file)
@@ -65,7 +65,11 @@ public abstract class AbstractErrorTranslator implements IMDMessageTranslator<Of
 
             nodeErrBuilder.setTransactionId(new TransactionId(BigInteger.valueOf(message.getXid())));
 
-            Object object = sc.getbulkTransactionCache().getIfPresent(new TransactionKey(message.getXid()));
+            Object object = null;
+            if (sc != null) {
+                // sessionContext is available only after handshake finished
+                object = sc.getbulkTransactionCache().getIfPresent(new TransactionKey(message.getXid()));
+            }
 
             Uri uri = null;
             ObjectReference objRef = null;