diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java index c6fc52b22c3..a0bf03f1413 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java @@ -204,6 +204,10 @@ public class TextAttributeProps { ? PixelUtil.toPixelFromSP(mLetterSpacingInput) : PixelUtil.toPixelFromDIP(mLetterSpacingInput); + if (mFontSize <= 0) { + throw new IllegalArgumentException( + "FontSize should be a positive value. Current value: " + mFontSize); + } // `letterSpacingPixels` and `mFontSize` are both in pixels, // yielding an accurate em value. return letterSpacingPixels / mFontSize;