mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -04:00
Bug fix: crash when validating account
This commit is contained in:
parent
2d67fc2ab7
commit
88cf0d3cad
@ -34,20 +34,23 @@ public class YggdrasilAuthenticator {
|
||||
if (os != null) {
|
||||
os.close();
|
||||
}
|
||||
|
||||
int statusCode = conn.getResponseCode();
|
||||
if (statusCode != 200) {
|
||||
is = conn.getErrorStream();
|
||||
} else {
|
||||
is = conn.getInputStream();
|
||||
}
|
||||
IOUtils.copy(is, bos);
|
||||
|
||||
if (is != null) {
|
||||
IOUtils.copy(is, bos);
|
||||
try {
|
||||
is.close();
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
String outString = new String(bos.toByteArray(), Charset.forName("UTF-8"));
|
||||
if (statusCode == 200 || statusCode == 204){
|
||||
Log.i("Result", "Task " + endpoint + " successful");
|
||||
@ -58,6 +61,7 @@ public class YggdrasilAuthenticator {
|
||||
} else {
|
||||
Log.i("Result", "Task " + endpoint + " failure");
|
||||
}
|
||||
|
||||
if (responseClass == null) {
|
||||
return new NetworkResponse(statusCode, outString);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user