fix(license): fix maps:get/2 crash

This commit is contained in:
zhongwencool 2022-02-16 18:15:47 +08:00
parent 98b2cd683b
commit d900418ce2
1 changed files with 3 additions and 4 deletions

View File

@ -123,10 +123,9 @@ ensure_check_expiry_timer(State) ->
State#{expiry_alarm_timer => Ref}.
cancel_timer(State, Key) ->
Ref = maps:get(Key, State),
_ = case is_reference(Ref) of
true -> erlang:cancel_timer(Ref);
false -> ok
_ = case maps:find(Key, State) of
{ok, Ref} when is_reference(Ref) -> erlang:cancel_timer(Ref);
_ -> ok
end,
ok.