Merge pull request #5315 from ByteHamster/fix-sleeptimer-0
Fix crash when setting sleep timer to zero
This commit is contained in:
commit
05e6119f03
@ -153,10 +153,13 @@ public class SleepTimerDialog extends DialogFragment {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
long time = Long.parseLong(etxtTime.getText().toString());
|
||||
if (time == 0) {
|
||||
throw new NumberFormatException("Timer must not be zero");
|
||||
}
|
||||
SleepTimerPreferences.setLastTimer(etxtTime.getText().toString(), spTimeUnit.getSelectedItemPosition());
|
||||
long time = SleepTimerPreferences.timerMillis();
|
||||
if (controller != null) {
|
||||
controller.setSleepTimer(time);
|
||||
controller.setSleepTimer(SleepTimerPreferences.timerMillis());
|
||||
}
|
||||
closeKeyboard(content);
|
||||
} catch (NumberFormatException e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user