ONOS-2157: Fix NPE in Transaction execution logic

Change-Id: I55a73a82d5ba95407c451a7dd95832442625b994
diff --git a/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/PartitionedDatabase.java b/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/PartitionedDatabase.java
index 083ca86..c19bccd 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/PartitionedDatabase.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/PartitionedDatabase.java
@@ -312,7 +312,7 @@
                     subTransactions.entrySet().iterator().next();
             return entry.getKey().prepareAndCommit(entry.getValue());
         } else {
-            if (transactionManager != null) {
+            if (transactionManager == null) {
                 throw new IllegalStateException("TransactionManager is not initialized");
             }
             return transactionManager.execute(transaction);