fix: prevent boot crash when transition_animation_scale setting is malformed

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-07-25 14:12:56 +03:00
parent d5e335e575
commit 0267a6c41a
2 changed files with 14 additions and 7 deletions
@@ -13,12 +13,7 @@ class ExpoPlatformInfoModule : Module() {
Function("getIsReducedMotionEnabled") {
val resolver = appContext.reactContext?.contentResolver ?: return@Function false
val scale = Settings.Global.getString(resolver, Settings.Global.TRANSITION_ANIMATION_SCALE) ?: return@Function false
try {
return@Function scale.toFloat() == 0f
} catch (_: Error) {
return@Function false
}
return@Function scale.toFloatOrNull() == 0f
}
}
}