commit: d0ee899ab94788e37e6ac3c43342017d1b27903a
parent 123093a1868b25f101dfc4b02895c22a0daf5733
Author: Mark Felder <feld@feld.me>
Date: Tue, 17 Sep 2024 13:14:09 -0400
Only close connection if it is not nil
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/pleroma/ldap.ex b/lib/pleroma/ldap.ex
@@ -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