diff --git a/src/hanoidb_level.erl b/src/hanoidb_level.erl index 7359e4c..a7459c0 100644 --- a/src/hanoidb_level.erl +++ b/src/hanoidb_level.erl @@ -547,7 +547,9 @@ main_loop(State = #state{ next=Next }) -> end; ?CAST(_From,{merge_done, Count, OutFileName}) - when Count =< ?BTREE_SIZE(State#state.level), State#state.c =:= undefined -> + when Count =< ?BTREE_SIZE(State#state.level), + State#state.c =:= undefined, + Next =:= undefined -> ?log("merge_done, out:~w~n -> self", [Count]),