mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-03 05:48:42 +00:00
Only close connection if it is not nil
This commit is contained in:
parent
123093a186
commit
d0ee899ab9
1 changed files with 5 additions and 1 deletions
|
@ -84,7 +84,11 @@ defmodule Pleroma.LDAP do
|
|||
|
||||
@impl true
|
||||
def terminate(_, state) do
|
||||
:eldap.close(state[:connection])
|
||||
connection = Keyword.get(state, :connection)
|
||||
|
||||
if not is_nil(connection) do
|
||||
:eldap.close(connection)
|
||||
end
|
||||
|
||||
:ok
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue