add safety code

This commit is contained in:
jacques 2020-07-18 20:17:24 +02:00
parent de3d38983e
commit 8822b8d679

View file

@ -51,6 +51,7 @@ public class MedicamentDetailFragment extends Fragment {
medicament = (Medicament) getArguments().getSerializable(ARG_ITEM_ID);
Activity activity = this.getActivity();
assert activity != null;
CollapsingToolbarLayout appBarLayout = activity.findViewById(R.id.toolbar_layout);
if (appBarLayout != null) {
appBarLayout.setTitle(medicament.getNom());