Skip to content

Commit 70b7955

Browse files
pietropizzialvaromb
authored andcommitted
Make sure keyboardWill(Show|Hide)Event exists (#79)
It can be undefined causing app crashes
1 parent 4302b97 commit 70b7955

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/KeyboardAwareMixin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ const KeyboardAwareMixin = {
9393
},
9494

9595
componentWillUnmount: function () {
96-
this.keyboardWillShowEvent.remove()
97-
this.keyboardWillHideEvent.remove()
96+
this.keyboardWillShowEvent && this.keyboardWillShowEvent.remove()
97+
this.keyboardWillHideEvent && this.keyboardWillHideEvent.remove()
9898
},
9999

100100
scrollToPosition: function (x: number, y: number, animated: bool = false) {

0 commit comments

Comments
 (0)