Repository: incubator-ratis
Updated Branches:
  refs/heads/master 99e409b66 -> ce3afb08f


RATIS-171. The FileStore tests fail with NullPointerException.  Contributed by 
Kit Hui


Project: http://git-wip-us.apache.org/repos/asf/incubator-ratis/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ratis/commit/ce3afb08
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ratis/tree/ce3afb08
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ratis/diff/ce3afb08

Branch: refs/heads/master
Commit: ce3afb08fd3a5f00a46347ab4be3e7fc6958448f
Parents: 99e409b
Author: Tsz-Wo Nicholas Sze <[email protected]>
Authored: Mon Dec 18 18:58:20 2017 +0800
Committer: Tsz-Wo Nicholas Sze <[email protected]>
Committed: Mon Dec 18 18:58:20 2017 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/ratis/server/storage/RaftLogWorker.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/ce3afb08/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftLogWorker.java
----------------------------------------------------------------------
diff --git 
a/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftLogWorker.java 
b/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftLogWorker.java
index 81bd22d..eaf0459 100644
--- 
a/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftLogWorker.java
+++ 
b/ratis-server/src/main/java/org/apache/ratis/server/storage/RaftLogWorker.java
@@ -276,12 +276,12 @@ class RaftLogWorker implements Runnable {
       this.entry = ProtoUtils.removeStateMachineData(entry);
       if (this.entry == entry || stateMachine == null) {
         this.stateMachineFuture = null;
-        this.combined = super.getFuture();
       } else {
         // this.entry != entry iff the entry has state machine data
         this.stateMachineFuture = stateMachine.writeStateMachineData(entry);
-        this.combined = super.getFuture().thenCombine(stateMachineFuture, 
(index, stateMachineResult) -> index);
       }
+      this.combined = stateMachineFuture == null? super.getFuture()
+          : super.getFuture().thenCombine(stateMachineFuture, (index, 
stateMachineResult) -> index);
     }
 
     @Override

Reply via email to