check for null

This commit is contained in:
Milos Kozak 2017-08-06 14:14:03 +02:00
parent 066283a4b0
commit f1f7a6ca6c

View file

@ -183,7 +183,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
profile = MainApp.getConfigBuilder().getProfile(); profile = MainApp.getConfigBuilder().getProfile();
profileStore = ConfigBuilderPlugin.getActiveProfileInterface().getProfile(); profileStore = ConfigBuilderPlugin.getActiveProfileInterface().getProfile();
ArrayList<CharSequence> profileList; ArrayList<CharSequence> profileList;
units = profile.getUnits(); units = profile != null ? profile.getUnits() : Constants.MGDL;
profileList = profileStore.getProfileList(); profileList = profileStore.getProfileList();
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getContext(), ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getContext(),
R.layout.spinner_centered, profileList); R.layout.spinner_centered, profileList);