From 8b8ee8dae3f7ec0006805d4de3d62268b9adf721 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 15 Jul 2011 00:26:26 -0700 Subject: [PATCH] Handle possible NPE in mapping loader. --- .../guacamole/net/basic/BasicFileAuthenticationProvider.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guacamole/src/main/java/net/sourceforge/guacamole/net/basic/BasicFileAuthenticationProvider.java b/guacamole/src/main/java/net/sourceforge/guacamole/net/basic/BasicFileAuthenticationProvider.java index ce8d5b8ed..a00d6eeb2 100644 --- a/guacamole/src/main/java/net/sourceforge/guacamole/net/basic/BasicFileAuthenticationProvider.java +++ b/guacamole/src/main/java/net/sourceforge/guacamole/net/basic/BasicFileAuthenticationProvider.java @@ -100,6 +100,11 @@ public class BasicFileAuthenticationProvider implements AuthenticationProvider { } + // If no mapping available, report as such + if (mapping == null) + throw new GuacamoleException("User mapping could not be read."); + + // Validate and return info for given user and pass AuthInfo info = mapping.get(username); if (info != null && info.validate(username, password)) return info.getConfiguration();