From 7078ef5d2bdcbc41ca1c548098d618388dfebf34 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Mon, 3 Mar 2025 13:43:55 -0400 Subject: [PATCH] Ensure parent window token is non-null before trying to display Wifi popup. --- .../securesms/components/webrtc/WifiToCellularPopupWindow.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WifiToCellularPopupWindow.kt b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WifiToCellularPopupWindow.kt index 857110b40c..6a1a9ada3c 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WifiToCellularPopupWindow.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WifiToCellularPopupWindow.kt @@ -25,6 +25,10 @@ class WifiToCellularPopupWindow(private val parent: ViewGroup) : PopupWindow( } fun show() { + if (parent.windowToken == null) { + return + } + showAtLocation(parent, Gravity.TOP or Gravity.START, 0, 0) VibrateUtil.vibrate(parent.context, VIBRATE_DURATION_MS) contentView.postDelayed(DISPLAY_DURATION_MS) {