No need to create Map if user not valid.
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Wed, 21 Dec 2011 08:09:51 +0000 (00:09 -0800)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Wed, 21 Dec 2011 08:09:51 +0000 (00:09 -0800)
src/main/java/net/sourceforge/guacamole/net/basic/BasicFileAuthenticationProvider.java

index 91a6b1b..3f14763 100644 (file)
@@ -133,11 +133,10 @@ public class BasicFileAuthenticationProvider implements AuthenticationProvider<U
         if (mapping == null)
             throw new GuacamoleException("User mapping could not be read.");
         
-        Map<String, GuacamoleConfiguration> configs = new HashMap<String, GuacamoleConfiguration>();
-        
         // Validate and return info for given user and pass
         AuthInfo info = mapping.get(credentials.getUsername());
         if (info != null && info.validate(credentials.getUsername(), credentials.getPassword())) {
+            Map<String, GuacamoleConfiguration> configs = new HashMap<String, GuacamoleConfiguration>();
             configs.put("DEFAULT", info.getConfiguration());
             return configs;
         }