add null check for keyboardFrame variable in KeyboardAvoidingView component

Summary:
This is a critical change and should be pushed to stabel asap

The reason for the pull request is to prevent crashes that can occure if the function relativeKeyboardHeight(keyboardFrame: ScreenRect) got null as an input variable which sometimes does happen.
Closes https://github.com/facebook/react-native/pull/10287

Differential Revision: D3988359

Pulled By: bestander

fbshipit-source-id: 0d1052b590b2684907ea6f7d6b4fe9b89989d4dd
This commit is contained in:
Isak Dunér 2016-10-08 20:24:53 -07:00 committed by Facebook Github Bot
parent b7ded130df
commit 770091f3c1
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ const KeyboardAvoidingView = React.createClass({
relativeKeyboardHeight(keyboardFrame: ScreenRect): number {
const frame = this.frame;
if (!frame) {
if (!frame || !keyboardFrame) {
return 0;
}