Skip to content

Commit

Permalink
Avoids NullPointerException when shutting down PVAServer
Browse files Browse the repository at this point in the history
  • Loading branch information
jacomago committed Nov 15, 2023
1 parent 0ed38e3 commit cdd521d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.util.Objects;
import java.util.logging.Level;

import org.epics.pva.common.CommandHandlers;
Expand Down Expand Up @@ -62,7 +63,7 @@ class ServerTCPHandler extends TCPHandler
public ServerTCPHandler(final PVAServer server, final Socket client, final TLSHandshakeInfo tls_info) throws Exception
{
super(client, false);
this.server = server;
this.server = Objects.requireNonNull(server);
this.tls_info = tls_info;

server.register(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -57,7 +58,7 @@ class ServerTCPListener

public ServerTCPListener(final PVAServer server) throws Exception
{
this.server = server;
this.server = Objects.requireNonNull(server);

// Is TLS configured?
final boolean tls = !PVASettings.EPICS_PVAS_TLS_KEYCHAIN.isBlank();
Expand Down

0 comments on commit cdd521d

Please sign in to comment.