Avoid npe if no string is assigned to the profile switch

This commit is contained in:
AdrianLxM 2017-08-17 21:24:31 +02:00 committed by GitHub
parent 92077dcb6a
commit 0cc9ee4193

View file

@ -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);
}
}
}