aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http2.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_http2.erl')
-rw-r--r--src/cowboy_http2.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cowboy_http2.erl b/src/cowboy_http2.erl
index 601ea98..5e72870 100644
--- a/src/cowboy_http2.erl
+++ b/src/cowboy_http2.erl
@@ -485,7 +485,10 @@ frame(State0=#state{socket=Socket, transport=Transport, opts=Opts,
%% Ack for a previously sent SETTINGS frame.
frame(State0=#state{local_settings=Local0, next_settings=NextSettings,
next_settings_timer=TRef}, settings_ack) ->
- ok = erlang:cancel_timer(TRef, [{async, true}, {info, false}]),
+ ok = case TRef of
+ undefined -> ok;
+ _ -> erlang:cancel_timer(TRef, [{async, true}, {info, false}])
+ end,
Local = maps:merge(Local0, NextSettings),
State1 = State0#state{local_settings=Local, next_settings=#{},
next_settings_timer=undefined},