Merge pull request #13 from TomConner/next

Fix WEB-151 - tolerate missing user cookie attribute in challenge stage2
This commit is contained in:
mayhew64 2014-09-20 09:40:22 -06:00
commit 3814b35aa8

View File

@ -210,7 +210,12 @@ public class Challenge2Screen extends SequentialLessonAdapter
.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); .createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
// pull the USER_COOKIE from the cookies // pull the USER_COOKIE from the cookies
String cookie = URLDecoder.decode(getCookie(s),"utf-8"); String cookie = getCookie(s);
if (null == cookie) {
cookie = "";
} else {
cookie = URLDecoder.decode(cookie,"utf-8");
}
String user = Encoding.base64Decode(cookie); String user = Encoding.base64Decode(cookie);
String query = "SELECT * FROM user_data WHERE last_name = '" + user + "'"; String query = "SELECT * FROM user_data WHERE last_name = '" + user + "'";