Fixed null pointer with invalid password

This commit is contained in:
Obique PSWG
2016-01-18 12:04:04 -06:00
parent 8132c23bfb
commit 8ea4d72dd9
@@ -123,10 +123,7 @@ public class OnlineInterfaceService extends Service implements HttpServerCallbac
}
}
if (!socket.isSecure()) {
String host = request.getURI().getHost();
if (host == null)
host = socket.getInetAddress().getHostName();
socket.redirect(new URL("https", host, httpsServer.getBindPort(), request.getURI().getPath()).toString());
socket.redirect(new URL("https", socket.getInetAddress().getHostName(), httpsServer.getBindPort(), request.getURI().getPath()).toString());
return;
}
handler.handleRequest(socket, request);
@@ -186,7 +183,7 @@ public class OnlineInterfaceService extends Service implements HttpServerCallbac
Log.i(TAG, "[%s] Successfully logged in to online interface", username);
} else {
Log.w(TAG, "[%s] Failed to login to online interface. Incorrect user/pass", username);
socket.redirect(new URL("https", httpsServer.getBindAddress().getHostName(), httpsServer.getBindPort(), "/").toString());
socket.redirect(new URL("https", socket.getInetAddress().getHostName(), httpsServer.getBindPort(), "/").toString());
}
} catch (IOException e) {
e.printStackTrace();