Fix CID 1386104 (Dereference null return value)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-06-29 17:40:06 +02:00
parent 4bebf3a5a3
commit 2a30d77d75

View File

@ -96,6 +96,10 @@ public class ScrollView {
!socket.isOutputShutdown() && !socket.isOutputShutdown() &&
socket.isConnected() && socket.isBound()) { socket.isConnected() && socket.isBound()) {
inputLine = receiveMessage(); inputLine = receiveMessage();
if (inputLine == null) {
// End of stream reached.
break;
}
nrInputLines++; nrInputLines++;
if (debugViewNetworkTraffic) { if (debugViewNetworkTraffic) {
System.out.println("(c->S," + nrInputLines + ")" + inputLine); System.out.println("(c->S," + nrInputLines + ")" + inputLine);