Only close connection if it is not nil
This commit is contained in:
parent
123093a186
commit
d0ee899ab9
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user