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:
Родитель
b7ded130df
Коммит
770091f3c1
|
@ -87,7 +87,7 @@ const KeyboardAvoidingView = React.createClass({
|
||||||
|
|
||||||
relativeKeyboardHeight(keyboardFrame: ScreenRect): number {
|
relativeKeyboardHeight(keyboardFrame: ScreenRect): number {
|
||||||
const frame = this.frame;
|
const frame = this.frame;
|
||||||
if (!frame) {
|
if (!frame || !keyboardFrame) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче