Handle closing without an active handle (again)

This commit is contained in:
martinsumner 2016-11-05 11:24:48 +00:00
parent 61c6269200
commit 309ca2d6a1

View file

@ -388,7 +388,12 @@ terminate(Reason, State) ->
ok = file:close(State#state.handle),
ok = file:delete(State#state.filename);
_ ->
ok = file:close(State#state.handle)
case State#state.handle of
undefined ->
ok;
Handle ->
ok = file:close(Handle)
end
end.
code_change(_OldVsn, State, _Extra) ->