Skip to content

Commit 0e3d341

Browse files
Merge pull request #255 from syncfusion/resolve-animation-exception
Resolved the issue of exception during animation enabled check by applying a default value
2 parents 7d98638 + 49d407e commit 0e3d341

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)