Guard against null transaction IDs
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardTransaction.java
index 4f59f9feb52a5da87310d8d5e442bd2ca4dcf6b8..6597ce365c102fa0f8c639ae85331bd4d475f9ff 100644 (file)
@@ -58,7 +58,7 @@ public abstract class ShardTransaction extends AbstractUntypedActorWithMetering
         super("shard-tx"); //actor name override used for metering. This does not change the "real" actor name
         this.shardActor = shardActor;
         this.shardStats = shardStats;
-        this.transactionID = transactionID;
+        this.transactionID = Preconditions.checkNotNull(transactionID);
         this.clientTxVersion = clientTxVersion;
     }
 
@@ -164,7 +164,7 @@ public abstract class ShardTransaction extends AbstractUntypedActorWithMetering
             this.shardActor = shardActor;
             this.shardStats = shardStats;
             this.datastoreContext = datastoreContext;
-            this.transactionID = transactionID;
+            this.transactionID = Preconditions.checkNotNull(transactionID);
             this.txnClientVersion = txnClientVersion;
             this.type = type;
         }