Fix 500 internal error when autologin option is not specified in the config

This commit is contained in:
simon 2018-12-21 10:23:03 -05:00
parent 5de909cd9c
commit bbaa338469

View File

@ -15,7 +15,7 @@ public class PlayPage implements TemplateViewRoute {
public ModelAndView handle(Request request, Response response) {
String autoLogin = GameServer.INSTANCE.getConfig().getString("autologin");
if (!autoLogin.equals("")) {
if (autoLogin != null && !autoLogin.equals("")) {
AlertMessage[] messages = {new AlertMessage("Logged in as " + autoLogin, AlertType.SUCCESS)};
request.session().attribute("messages", messages);
request.session().attribute("username", autoLogin);