Only close connection if it is not nil

This commit is contained in:
Mark Felder 2024-09-17 13:14:09 -04:00
parent 123093a186
commit d0ee899ab9

View file

@ -84,7 +84,11 @@ defmodule Pleroma.LDAP do
@impl true @impl true
def terminate(_, state) do def terminate(_, state) do
:eldap.close(state[:connection]) connection = Keyword.get(state, :connection)
if not is_nil(connection) do
:eldap.close(connection)
end
:ok :ok
end end