Fixes NullPointerException at parse by checking if the line is null instead of checking if the line is empty

This commit is contained in:
Fuzzlemann 2017-07-23 13:36:18 +02:00
parent cf721a84a1
commit 7e03c1dcc0

View File

@ -1,13 +1,10 @@
package main.java.com.djrapitops.plan.ui.webserver; package main.java.com.djrapitops.plan.ui.webserver;
import java.io.BufferedReader; import main.java.com.djrapitops.plan.Log;
import java.io.Closeable;
import java.io.IOException; import java.io.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays; import java.util.Arrays;
import java.util.Optional; import java.util.Optional;
import main.java.com.djrapitops.plan.Log;
/** /**
* Represents a HTTP Request. * Represents a HTTP Request.
@ -57,7 +54,7 @@ public class Request implements Closeable {
BufferedReader in = new BufferedReader(new InputStreamReader(input)); BufferedReader in = new BufferedReader(new InputStreamReader(input));
close = in; close = in;
String line; String line;
while (!(line = in.readLine()).isEmpty()) { while ((line = in.readLine()) != null) {
headerB.append(line); headerB.append(line);
headerB.append(":::"); headerB.append(":::");
} }