From 27c4fe33095ae06bb96dac58a2bbc2eb4ce2f0aa Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 27 Mar 2018 21:43:35 +0200 Subject: [PATCH] fix NPE --- .../androidaps/plugins/ProfileNS/NSProfileFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfileFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfileFragment.java index f47ef8a686..95e938a066 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfileFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfileFragment.java @@ -147,7 +147,7 @@ public class NSProfileFragment extends SubscriberFragment { @OnClick(R.id.nsprofile_profileswitch) public void onClickProfileSwitch() { - String name = profileSpinner.getSelectedItem().toString(); + String name = profileSpinner.getSelectedItem() != null ? profileSpinner.getSelectedItem().toString() : ""; ProfileStore store = NSProfilePlugin.getPlugin().getProfile(); if (store != null) { Profile profile = store.getSpecificProfile(name);