From 6daba3b9e745054b53b7083d9cd7849b4760b177 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 29 Jul 2019 23:24:55 +0200 Subject: [PATCH] fix crash in NumberPicker --- .../java/info/nightscout/androidaps/utils/NumberPicker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } } });