diff --git a/app/src/main/java/info/nightscout/androidaps/utils/NumberPicker.java b/app/src/main/java/info/nightscout/androidaps/utils/NumberPicker.java index baeff5f239..b125d0b2a3 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/NumberPicker.java +++ b/app/src/main/java/info/nightscout/androidaps/utils/NumberPicker.java @@ -163,13 +163,15 @@ public class NumberPicker extends LinearLayout implements View.OnKeyListener, value = maxValue; ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.youareonallowedlimit)); updateEditText(); - okButton.setVisibility(VISIBLE); + if (okButton != null) + okButton.setVisibility(VISIBLE); } if (value < minValue) { value = minValue; ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.gs(R.string.youareonallowedlimit)); updateEditText(); - okButton.setVisibility(VISIBLE); + if (okButton != null) + okButton.setVisibility(VISIBLE); } } });