From 770091f3c13f7c1bd77c50f979d89a774001fbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isak=20Dun=C3=A9r?= Date: Sat, 8 Oct 2016 20:24:53 -0700 Subject: [PATCH] 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 --- Libraries/Components/Keyboard/KeyboardAvoidingView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index 312557321c..e7d9b3c967 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -87,7 +87,7 @@ const KeyboardAvoidingView = React.createClass({ relativeKeyboardHeight(keyboardFrame: ScreenRect): number { const frame = this.frame; - if (!frame) { + if (!frame || !keyboardFrame) { return 0; }