diff options
author | Ingo Bauersachs <ingo@jitsi.org> | 2013-12-05 20:59:46 +0100 |
---|---|---|
committer | Ingo Bauersachs <ingo@jitsi.org> | 2013-12-05 20:59:46 +0100 |
commit | e5d53660a2922921aa34f989fc480b7444041a83 (patch) | |
tree | 4a5f361e2472c831575a3cd03dc454970ca76a6f | |
parent | 17ad247125cea73720e16c2797f867224149fb92 (diff) | |
download | jitsi-e5d53660a2922921aa34f989fc480b7444041a83.zip jitsi-e5d53660a2922921aa34f989fc480b7444041a83.tar.gz jitsi-e5d53660a2922921aa34f989fc480b7444041a83.tar.bz2 |
Ensure that the auto-away value from config falls in the valid range
-rw-r--r-- | src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayConfigurationPanel.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayConfigurationPanel.java b/src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayConfigurationPanel.java index a0160d8..f3331cf 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayConfigurationPanel.java +++ b/src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayConfigurationPanel.java @@ -130,7 +130,15 @@ public class AutoAwayConfigurationPanel this.enable.setSelected(enabled); this.timer.setEnabled(enabled); - this.timer.setValue(Preferences.getTimer()); + int timerValue = Preferences.getTimer(); + SpinnerNumberModel model = (SpinnerNumberModel)this.timer.getModel(); + if (timerValue < (Integer)model.getMinimum() + || timerValue > (Integer)model.getMaximum()) + { + timerValue = Preferences.DEFAULT_TIMER; + } + + this.timer.setValue(timerValue); } /** |