mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +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
|
@Override
|
||||||
public GuacamoleSession get(String authToken) {
|
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
|
// Update the last access time and return the GuacamoleSession
|
||||||
GuacamoleSession session = sessionMap.get(authToken);
|
GuacamoleSession session = sessionMap.get(authToken);
|
||||||
if (session != null)
|
if (session != null)
|
||||||
@@ -167,7 +171,14 @@ public class BasicTokenSessionMap implements TokenSessionMap {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GuacamoleSession remove(String authToken) {
|
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);
|
return sessionMap.remove(authToken);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user