From 1fb5424b5532ff58ac6c55510d87d5674cc5d89b Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 17 Apr 2014 22:13:25 -0400 Subject: [PATCH] [findbugs] Null check on closing PAM provider --- src/main/java/com/gitblit/auth/PAMAuthProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gitblit/auth/PAMAuthProvider.java b/src/main/java/com/gitblit/auth/PAMAuthProvider.java index 7e82bc63..5d441b84 100644 --- a/src/main/java/com/gitblit/auth/PAMAuthProvider.java +++ b/src/main/java/com/gitblit/auth/PAMAuthProvider.java @@ -98,7 +98,9 @@ public class PAMAuthProvider extends UsernamePasswordAuthenticationProvider { logger.error(e.getMessage()); return null; } finally { - pam.dispose(); + if (pam != null) { + pam.dispose(); + } } UserModel user = userManager.getUserModel(username); -- 2.39.5