# HG changeset patch # User Jaroslav Tulach # Date 1252937499 -7200 # Node ID 3574b08dc3c33bbabe9c64e731253201c5a17ecf # Parent 824d66048bace554c9eb82f57118ca5a44b463a1 Surviving attemps to log in with invalid loginID diff -r 824d66048bac -r 3574b08dc3c3 freemarkerdor/pom.xml --- a/freemarkerdor/pom.xml Mon Sep 14 12:03:12 2009 +0200 +++ b/freemarkerdor/pom.xml Mon Sep 14 16:11:39 2009 +0200 @@ -10,6 +10,7 @@ org.apidesign freemarkerdor freemarkerdor + 1.8 http://maven.apache.org @@ -100,7 +101,6 @@ - 1.7 diff -r 824d66048bac -r 3574b08dc3c3 freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java --- a/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Mon Sep 14 12:03:12 2009 +0200 +++ b/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Mon Sep 14 16:11:39 2009 +0200 @@ -76,8 +76,14 @@ private Viewable checkLogin() { if (headers.getCookies().containsKey("login")) { String id = headers.getCookies().get("login").getValue(); - String us = base.path("login").queryParam("id", id). - accept(MediaType.TEXT_PLAIN).get(String.class); + String us; + try { + us = base.path("login").queryParam("id", id). + accept(MediaType.TEXT_PLAIN).get(String.class); + } catch (UniformInterfaceException ex) { + ex.printStackTrace(); + us = ""; + } if (us.length() > 0) { user = us; uuid = id; diff -r 824d66048bac -r 3574b08dc3c3 webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java --- a/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java Mon Sep 14 12:03:12 2009 +0200 +++ b/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java Mon Sep 14 16:11:39 2009 +0200 @@ -105,11 +105,15 @@ public String isLoggedIn( @QueryParam("id") String id ) { + String ret = null; try { - return id == null ? "" : loggedIn.get(UUID.fromString(id)); + if (id != null) { + ret = loggedIn.get(UUID.fromString(id)); + } } catch (IllegalArgumentException ex) { - return ""; + // OK, happens for invalid ids } + return ret == null ? "" : ret; } //