mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
Check for null error streams
This commit is contained in:
@@ -215,7 +215,9 @@ public class DeepL {
|
||||
if (status != HttpsURLConnection.HTTP_OK) {
|
||||
String error = "Error " + status + ": " + connection.getResponseMessage();
|
||||
try {
|
||||
error += "\n" + Helper.readStream(connection.getErrorStream());
|
||||
InputStream is = connection.getErrorStream();
|
||||
if (is != null)
|
||||
error += "\n" + Helper.readStream(is);
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
@@ -257,7 +259,9 @@ public class DeepL {
|
||||
if (status != HttpsURLConnection.HTTP_OK) {
|
||||
String error = "Error " + status + ": " + connection.getResponseMessage();
|
||||
try {
|
||||
error += "\n" + Helper.readStream(connection.getErrorStream());
|
||||
InputStream is = connection.getErrorStream();
|
||||
if (is != null)
|
||||
error += "\n" + Helper.readStream(is);
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user