mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Merge pull request #311 from glyptodon/login-npe
GUAC-1442: Do not attempt to remove/retrieve tokens that do not exist.
This commit is contained in:
@@ -151,6 +151,10 @@ public class BasicTokenSessionMap implements TokenSessionMap {
|
||||
@Override
|
||||
public GuacamoleSession get(String authToken) {
|
||||
|
||||
// There are no null auth tokens
|
||||
if (authToken == null)
|
||||
return null;
|
||||
|
||||
// Update the last access time and return the GuacamoleSession
|
||||
GuacamoleSession session = sessionMap.get(authToken);
|
||||
if (session != null)
|
||||
@@ -167,7 +171,14 @@ public class BasicTokenSessionMap implements TokenSessionMap {
|
||||
|
||||
@Override
|
||||
public GuacamoleSession remove(String authToken) {
|
||||
|
||||
// There are no null auth tokens
|
||||
if (authToken == null)
|
||||
return null;
|
||||
|
||||
// Attempt to retrieve only if non-null
|
||||
return sessionMap.remove(authToken);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user