From e253d6ac9a2c000c75122656385aa72390459ef4 Mon Sep 17 00:00:00 2001 From: Amr Hossam Date: Wed, 30 Oct 2024 03:59:56 +0300 Subject: [PATCH] fix: trip-end receiver crash Signed-off-by: Amr Hossam --- .../org/onebusaway/android/ui/TripDetailsListFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/ui/TripDetailsListFragment.java b/onebusaway-android/src/main/java/org/onebusaway/android/ui/TripDetailsListFragment.java index 5be19cfeb..9f12b17d0 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/ui/TripDetailsListFragment.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/ui/TripDetailsListFragment.java @@ -1231,7 +1231,9 @@ public void onReceive(Context context, Intent intent) { mAdapter.notifyDataSetChanged(); // Unregister this receiver now - getActivity().unregisterReceiver(this); + if(getActivity() != null) { + getActivity().unregisterReceiver(this); + } } } }