mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 08:30:34 +00:00
Fixes NPE in setFontWeight method
Summary: We have a crash in prod t11090540, urgent fix same way as in setFontStyle Closes https://github.com/facebook/react-native/pull/7362 Reviewed By: foghina Differential Revision: D3254158 Pulled By: dmmiller fb-gh-sync-id: a497d0d4d0e4df9284e328ebb14fee74ba2f899b fbshipit-source-id: a497d0d4d0e4df9284e328ebb14fee74ba2f899b
This commit is contained in:
parent
bb39a2e9da
commit
1fb8643cb6
@ -199,8 +199,12 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
(fontWeightNumeric != -1 && fontWeightNumeric < 500)) {
|
||||
fontWeight = Typeface.NORMAL;
|
||||
}
|
||||
if (fontWeight != view.getTypeface().getStyle()) {
|
||||
view.setTypeface(view.getTypeface(), fontWeight);
|
||||
Typeface currentTypeface = view.getTypeface();
|
||||
if (currentTypeface == null) {
|
||||
currentTypeface = Typeface.DEFAULT;
|
||||
}
|
||||
if (fontWeight != currentTypeface.getStyle()) {
|
||||
view.setTypeface(currentTypeface, fontWeight);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user