Fix potential NPE when the input stream is closed too soon in the old network API
This commit is contained in:
parent
a73f428bc4
commit
9a945c950e
@ -26,10 +26,14 @@ public class ResponseAnalyser {
|
|||||||
|
|
||||||
// lecture de la première ligne
|
// lecture de la première ligne
|
||||||
line = in.readLine();
|
line = in.readLine();
|
||||||
|
if (line == null)
|
||||||
|
throw new IOException("Not enough data to read first line of response.");
|
||||||
good = line.equalsIgnoreCase("OK");
|
good = line.equalsIgnoreCase("OK");
|
||||||
|
|
||||||
// lecture de la deuxième ligne
|
// lecture de la deuxième ligne
|
||||||
line = in.readLine();
|
line = in.readLine();
|
||||||
|
if (line == null)
|
||||||
|
throw new IOException("Not enough data to read second line of response.");
|
||||||
|
|
||||||
int data_size = 0;
|
int data_size = 0;
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user