Ensure parent window token is non-null before trying to display Wifi popup.

This commit is contained in:
Alex Hart
2025-03-03 13:43:55 -04:00
committed by Greyson Parrelli
parent d3be5807b5
commit 7078ef5d2b

View File

@@ -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) {