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 #24288

Reviewed By: sahrens

Differential Revision: D14765625

fbshipit-source-id: f7275f3735691e1f0c87e682f6dd675e5ba5a7c0
  • Loading branch information
cpojer authored and facebook-github-bot committed Apr 4, 2019
1 parent da44010 commit e62cfc0
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 e62cfc0

Please sign in to comment.