diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-06 00:59:59 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-06 00:59:59 +0000 |
commit | 28dc434be00db44ebd028fc7663fd794a5a4e964 (patch) | |
tree | 921fe440ccfb64bffa3654396952727b34f5a26b /client/trunk/src | |
parent | e554fa7fbceeab7ca16b4be9b2671c19c8c36d90 (diff) | |
download | instadisc-28dc434be00db44ebd028fc7663fd794a5a4e964.tar.gz instadisc-28dc434be00db44ebd028fc7663fd794a5a4e964.tar.bz2 instadisc-28dc434be00db44ebd028fc7663fd794a5a4e964.zip |
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
Diffstat (limited to 'client/trunk/src')
-rw-r--r-- | client/trunk/src/com/fourisland/instadisc/InstaDiscView.java | 10 |
1 files changed, 6 insertions, 4 deletions
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 { | |||
378 | } | 378 | } |
379 | 379 | ||
380 | public void updateTimer() { | 380 | public void updateTimer() { |
381 | int delay = 0; | 381 | int delay = (1000 * 60 * 60); |
382 | 382 | ||
383 | if (ipCheckTimer.isRunning()) { | 383 | try { |
384 | ipCheckTimer.stop(); | 384 | ipCheckTimer.stop(); |
385 | } catch (NullPointerException ex) { | ||
386 | |||
385 | } | 387 | } |
386 | 388 | ||
387 | if (Wrapper.getConfig("ipCheckUnit").equals("day")) { | 389 | if (Wrapper.getConfig("ipCheckUnit").equals("day")) { |
388 | delay = 1000 * 60 * 60 * 24 * Integer.decode(Wrapper.getConfig("ipCheckValue")); | 390 | delay *= (24 * Integer.decode(Wrapper.getConfig("ipCheckValue"))); |
389 | } else if (Wrapper.getConfig("ipCheckUnit").equals("hour")) { | 391 | } else if (Wrapper.getConfig("ipCheckUnit").equals("hour")) { |
390 | delay = 1000 * 60 * 60 * Integer.decode(Wrapper.getConfig("ipCheckValue")); | 392 | delay *= Integer.decode(Wrapper.getConfig("ipCheckValue")); |
391 | } | 393 | } |
392 | 394 | ||
393 | ipCheckTimer = new Timer(delay, new ActionListener() { | 395 | ipCheckTimer = new Timer(delay, new ActionListener() { |