From 0cc9ee4193b9487bd4a8a82811e83218727420e5 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 17 Aug 2017 21:24:31 +0200 Subject: [PATCH] Avoid npe if no string is assigned to the profile switch --- .../plugins/Treatments/fragments/ProfileViewerDialog.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/ProfileViewerDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/ProfileViewerDialog.java index 0572bc936f..46decf0b77 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/ProfileViewerDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/ProfileViewerDialog.java @@ -88,7 +88,7 @@ public class ProfileViewerDialog extends DialogFragment { private void setContent() { Profile profile = null; ProfileSwitch profileSwitch = MainApp.getConfigBuilder().getProfileSwitchFromHistory(time); - if(profileSwitch!=null){ + if(profileSwitch!=null && profileSwitch.profileJson != null){ profile = profileSwitch.getProfileObject(); } if (profile != null) { @@ -105,9 +105,4 @@ public class ProfileViewerDialog extends DialogFragment { noProfile.setVisibility(View.VISIBLE); } } - - - - - }