]> source.dussan.org Git - gitblit.git/commitdiff
[findbugs] Null check on closing PAM provider
authorJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 02:13:25 +0000 (22:13 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 03:08:07 +0000 (23:08 -0400)
src/main/java/com/gitblit/auth/PAMAuthProvider.java

index 7e82bc6363381605648bd79b6f3247d5e73a98cc..5d441b8451c66997080f0b55bdbef6ac585fd9e0 100644 (file)
@@ -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);