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) {
|
if (os != null) {
|
||||||
os.close();
|
os.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
int statusCode = conn.getResponseCode();
|
int statusCode = conn.getResponseCode();
|
||||||
if (statusCode != 200) {
|
if (statusCode != 200) {
|
||||||
is = conn.getErrorStream();
|
is = conn.getErrorStream();
|
||||||
} else {
|
} else {
|
||||||
is = conn.getInputStream();
|
is = conn.getInputStream();
|
||||||
}
|
}
|
||||||
IOUtils.copy(is, bos);
|
|
||||||
if (is != null) {
|
if (is != null) {
|
||||||
|
IOUtils.copy(is, bos);
|
||||||
try {
|
try {
|
||||||
is.close();
|
is.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String outString = new String(bos.toByteArray(), Charset.forName("UTF-8"));
|
String outString = new String(bos.toByteArray(), Charset.forName("UTF-8"));
|
||||||
if (statusCode == 200 || statusCode == 204){
|
if (statusCode == 200 || statusCode == 204){
|
||||||
Log.i("Result", "Task " + endpoint + " successful");
|
Log.i("Result", "Task " + endpoint + " successful");
|
||||||
@ -58,6 +61,7 @@ public class YggdrasilAuthenticator {
|
|||||||
} else {
|
} else {
|
||||||
Log.i("Result", "Task " + endpoint + " failure");
|
Log.i("Result", "Task " + endpoint + " failure");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (responseClass == null) {
|
if (responseClass == null) {
|
||||||
return new NetworkResponse(statusCode, outString);
|
return new NetworkResponse(statusCode, outString);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user