diff --git a/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt b/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt index c62070131..135ea3e1f 100644 --- a/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +++ b/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt @@ -251,7 +251,7 @@ class KeyboardAnimationCallback( var progress = 0.0 try { - progress = abs((height / persistentKeyboardHeight)).let { if (it.isNaN()) 0.0 else it } + progress = abs((height / persistentKeyboardHeight)).let { if (it.isNaN() || it.isInfinite()) 0.0 else it } } catch (e: ArithmeticException) { // do nothing, just log an exception send progress as 0 Logger.w(TAG, "Caught arithmetic exception during `progress` calculation: $e")