From 28dc434be00db44ebd028fc7663fd794a5a4e964 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 6 Aug 2008 00:59:59 +0000 Subject: Client: Fixed IP Check Timer The Client was throwing an uncaught NullPointerException at startup because the program was attempting to check if the Timer was running or not before it was initilized. This has been fixed. Refs #21 --- client/trunk/src/com/fourisland/instadisc/InstaDiscView.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'client') diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java index b706126..24d18ee 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java @@ -378,16 +378,18 @@ public class InstaDiscView extends FrameView { } public void updateTimer() { - int delay = 0; + int delay = (1000 * 60 * 60); - if (ipCheckTimer.isRunning()) { + try { ipCheckTimer.stop(); + } catch (NullPointerException ex) { + } if (Wrapper.getConfig("ipCheckUnit").equals("day")) { - delay = 1000 * 60 * 60 * 24 * Integer.decode(Wrapper.getConfig("ipCheckValue")); + delay *= (24 * Integer.decode(Wrapper.getConfig("ipCheckValue"))); } else if (Wrapper.getConfig("ipCheckUnit").equals("hour")) { - delay = 1000 * 60 * 60 * Integer.decode(Wrapper.getConfig("ipCheckValue")); + delay *= Integer.decode(Wrapper.getConfig("ipCheckValue")); } ipCheckTimer = new Timer(delay, new ActionListener() { -- cgit 1.4.1