Skip to content

Commit 099f006

Browse files
authored
Merge pull request #735 from skydoves/fix/npe-windowtoken
Fix NPE issue for checking the isBinderAlive
2 parents 92e8922 + 5f7a9a6 commit 099f006

File tree

1 file changed

+3
-3
lines changed
  • balloon/src/main/kotlin/com/skydoves/balloon

1 file changed

+3
-3
lines changed

balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,10 +920,10 @@ public class Balloon private constructor(
920920
if (bodyWindow.contentView.parent != null) return false
921921

922922
// We should check if the anchor view's window token is valid.
923-
if (!anchor.windowToken.isBinderAlive) return false
923+
if (!anchor.isAttachedToWindow) return false
924924

925-
// We should check the anchor view is attached to the parent's window.
926-
return anchor.isAttachedToWindow
925+
// We should check the anchor view is attached to the parent's window. (#730)
926+
return anchor.windowToken.isBinderAlive
927927
}
928928

929929
private fun showOverlayWindow(anchor: View, subAnchors: List<View>) {

0 commit comments

Comments
 (0)