Skip to content

Commit 49d407e

Browse files
Removed the try catch block of animation enabled check by providing default value to avoid the exception occurs while triggering FirstChanceException of MAUI App
1 parent 28922df commit 49d407e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

maui/src/Core/Legend/AreaBase.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,9 @@ static bool IsAnimationEnabled()
181181
{
182182
bool isAnimationOn = true;
183183
#if ANDROID
184-
try
185-
{
186-
var handler = Application.Current?.Handler;
187-
float scale = Settings.Global.GetFloat(handler?.MauiContext?.Context?.ApplicationContext?.ContentResolver, Settings.Global.AnimatorDurationScale);
188-
isAnimationOn = scale != 0.0f;
189-
}
190-
catch
191-
{
192-
isAnimationOn = false;
193-
}
184+
var handler = Application.Current?.Handler;
185+
float scale = Settings.Global.GetFloat(handler?.MauiContext?.Context?.ApplicationContext?.ContentResolver, Settings.Global.AnimatorDurationScale, 0.0f);
186+
isAnimationOn = scale != 0.0f;
194187
#endif
195188
return isAnimationOn;
196189
}

0 commit comments

Comments
 (0)