diff --git a/test/test_raft.cpp b/test/test_raft.cpp index f2387c9..195f178 100644 --- a/test/test_raft.cpp +++ b/test/test_raft.cpp @@ -229,7 +229,9 @@ void test_follower_append_entries_small_term(void**) { raft->Process(mes); assert_true(messages.size() == 1); - auto reply = messages[0].Cast(); + auto maybeReply = messages[0].Maybe(); + assert_true(maybeReply); + auto reply = maybeReply.Cast(); assert_true(reply->Dst == 2); assert_false(reply->Success); }