Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: lsiepel <leosiepel@gmail.com>
  • Loading branch information
lsiepel committed Aug 17, 2023
1 parent 029d3c2 commit 98f037c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.net.Socket;
import java.net.SocketTimeoutException;

import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.denonmarantz.internal.config.DenonMarantzConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -48,7 +49,7 @@ public class DenonMarantzTelnetClientThread extends Thread {

private OutputStreamWriter out;

private BufferedReader in;
private @Nullable BufferedReader in;

public DenonMarantzTelnetClientThread(DenonMarantzConfiguration config, DenonMarantzTelnetListener listener) {
logger.debug("Denon listener created");
Expand All @@ -65,7 +66,10 @@ public void run() {

do {
try {
String line = in.readLine();
String line = null;
if (in != null) {
line = in.readLine();
}
if (line == null) {
logger.debug("No more data read from client. Disconnecting..");
listener.telnetClientConnected(false);
Expand Down

0 comments on commit 98f037c

Please sign in to comment.