From a711fea3d9ae97fcaddd7589b379fa72527fab95 Mon Sep 17 00:00:00 2001 From: David Gillingham Date: Tue, 23 Jul 2013 13:44:46 -0500 Subject: [PATCH] Issue #2009: Fix NullPointerException in SocketServer start up. Change-Id: I07683ba74410234d162e058df0bb3ff6e00ee59e Former-commit-id: b2b6220d5b5ef2235edb57fe2ab2ce0cb234ee25 --- MHSEmulator/src/mhs/core/SocketSrv.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MHSEmulator/src/mhs/core/SocketSrv.java b/MHSEmulator/src/mhs/core/SocketSrv.java index 66b43ea1f3..356f589df5 100644 --- a/MHSEmulator/src/mhs/core/SocketSrv.java +++ b/MHSEmulator/src/mhs/core/SocketSrv.java @@ -40,7 +40,8 @@ import java.util.regex.Pattern; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * ??? ?? ???? bphillip Initial creation - * Jul 15, 2013 #2099 dgilling Code cleanup. + * Jul 15, 2013 #2009 dgilling Code cleanup. + * Jul 23, 2013 #2009 dgilling Fix NullPointerException on start up. * * * @@ -146,8 +147,11 @@ public class SocketSrv { } public void run() throws IOException { - Runnable rsyncJob = new RsyncThread(serverProps); - rsyncThread.scheduleWithFixedDelay(rsyncJob, 1, 1, TimeUnit.SECONDS); + if (rsyncThread != null) { + Runnable rsyncJob = new RsyncThread(serverProps); + rsyncThread + .scheduleWithFixedDelay(rsyncJob, 1, 1, TimeUnit.SECONDS); + } ServerSocket socket = new ServerSocket(serverPort); while (!mhsRequestHandler.isShutdown()) {