fix crash in NumberPicker

This commit is contained in:
Milos Kozak 2019-07-29 23:24:55 +02:00
parent c0ec445fbe
commit 6daba3b9e7

View file

@ -163,13 +163,15 @@ public class NumberPicker extends LinearLayout implements View.OnKeyListener,
value = maxValue; value = maxValue;
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.youareonallowedlimit)); ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.youareonallowedlimit));
updateEditText(); updateEditText();
okButton.setVisibility(VISIBLE); if (okButton != null)
okButton.setVisibility(VISIBLE);
} }
if (value < minValue) { if (value < minValue) {
value = minValue; value = minValue;
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.youareonallowedlimit)); ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.youareonallowedlimit));
updateEditText(); updateEditText();
okButton.setVisibility(VISIBLE); if (okButton != null)
okButton.setVisibility(VISIBLE);
} }
} }
}); });