Fix WEB-151 - tolerate missing user cookie attribute in challenge stage2

This commit is contained in:
unknown 2014-09-20 01:37:51 -04:00
parent 3fd7b34536
commit ac410be6d9

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 + "'";