Skip to content

Commit

Permalink
fix: check for reference before demonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
rhblind committed Oct 21, 2024
1 parent 850a370 commit cc3c92d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/off_broadway/emqqt/broker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ defmodule OffBroadway.EMQTT.Broker do

@impl true
def terminate(_reason, state) do
Process.demonitor(state.emqtt_ref)
if is_reference(state.emqtt_ref), do: Process.demonitor(state.emqtt_ref)
:ets.delete(state.ets_table)
end

Expand Down

0 comments on commit cc3c92d

Please sign in to comment.