From 0e7cfda9a9767b3b55997cef89425aadde2776b3 Mon Sep 17 00:00:00 2001 From: Amr Hossam Date: Sun, 10 Mar 2024 14:31:30 +0200 Subject: [PATCH] Fixed #1157 - Dialog crash Signed-off-by: Amr Hossam --- .../onebusaway/android/ui/SituationDialogFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/ui/SituationDialogFragment.java b/onebusaway-android/src/main/java/org/onebusaway/android/ui/SituationDialogFragment.java index 4133138fd..c97bcce68 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/ui/SituationDialogFragment.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/ui/SituationDialogFragment.java @@ -162,10 +162,12 @@ public void onClick(DialogInterface dialog, int which) { TextView title = (TextView) dialog.findViewById(R.id.alert_title); title.setText(args.getString(TITLE)); - TextView desc = (TextView) dialog.findViewById(R.id.alert_description); + TextView descTxtView = (TextView) dialog.findViewById(R.id.alert_description); - if (desc != null) { - desc.setText(Html.fromHtml(args.getString(DESCRIPTION))); + String desc = args.getString(DESCRIPTION); + + if (descTxtView != null &&!TextUtils.isEmpty(desc)) { + descTxtView.setText(Html.fromHtml(desc)); } TextView urlView = (TextView) dialog.findViewById(R.id.alert_url);