Handle possible NPE in mapping loader.

This commit is contained in:
Michael Jumper
2011-07-15 00:26:26 -07:00
parent 493b43fe27
commit 8b8ee8dae3

View File

@@ -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); AuthInfo info = mapping.get(username);
if (info != null && info.validate(username, password)) if (info != null && info.validate(username, password))
return info.getConfiguration(); return info.getConfiguration();