Skip to content

Commit

Permalink
Fix logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Nov 14, 2024
1 parent ec0fafe commit 4169264
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ synchronized void tick() {
if (m_client != null) {
var conns = ntInstance.getConnections();

var newServer = conns[0].remote_ip;
if (conns.length > 0 && !m_client.getServer().equals(newServer)) {
logger.debug("Changing TimeSyncClient server to " + newServer);
m_client.setServer(newServer);
if (conns.length > 0) {
var newServer = conns[0].remote_ip;
if (!m_client.getServer().equals(newServer)) {
logger.debug("Changing TimeSyncClient server to " + newServer);
m_client.setServer(newServer);
}
}

if (m_client != null) {
Expand Down

0 comments on commit 4169264

Please sign in to comment.