Skip to content

Commit

Permalink
Fix crash in RCTText in open source RNTester
Browse files Browse the repository at this point in the history
Summary: See facebook#24288

Reviewed By: sahrens

Differential Revision: D14765625

fbshipit-source-id: f7275f3735691e1f0c87e682f6dd675e5ba5a7c0
  • Loading branch information
cpojer authored and zhongwuzw committed Apr 9, 2019
1 parent 92a676c commit 9ba68dc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ public BoxedIntPropSetter(ReactPropGroup prop, Method setter, int index) {
@Override
protected @Nullable Object getValueOrDefault(Object value) {
if (value != null) {
return (Integer) value;
if (value instanceof Double) {
return ((Double) value).intValue();
} else {
return (Integer) value;
}
}
return null;
}
Expand Down

0 comments on commit 9ba68dc

Please sign in to comment.