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

This commit is contained in:
Marc Baloup 2020-11-12 00:03:57 +01:00
parent a73f428bc4
commit 9a945c950e
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893
1 changed files with 4 additions and 0 deletions

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 {