Fix potential NPE when the input stream is closed too soon in the old network API

This commit is contained in:
2020-11-12 00:03:57 +01:00
parent a73f428bc4
commit 9a945c950e

View File

@@ -26,10 +26,14 @@ public class ResponseAnalyser {
// lecture de la première ligne
line = in.readLine();
if (line == null)
throw new IOException("Not enough data to read first line of response.");
good = line.equalsIgnoreCase("OK");
// lecture de la deuxième ligne
line = in.readLine();
if (line == null)
throw new IOException("Not enough data to read second line of response.");
int data_size = 0;
try {