Skip to content

Commit

Permalink
add null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspimentel committed Jan 6, 2025
1 parent e7ed2fe commit 5f9ec95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/ClipPing/Overlays/BorderOverlay.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ public async Task ShowAsync(Rect area)

Show();

var appear = (Animation)Resources["Appear"];
var disappear = (Animation)Resources["Disappear"];

await appear.RunAsync(this);
await disappear.RunAsync(this);
if(Resources["Appear"] is Animation appear &&
Resources["Disappear"] is Animation disappear)
{
await appear.RunAsync(this);
await disappear.RunAsync(this);
}

Close();
}
Expand Down
11 changes: 6 additions & 5 deletions src/ClipPing/Overlays/TopOverlay.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ public async Task ShowAsync(Rect area)

Show();

var appear = (Animation)Resources["Appear"];
var disappear = (Animation)Resources["Disappear"];

await appear.RunAsync(this);
await disappear.RunAsync(this);
if(Resources["Appear"] is Animation appear &&
Resources["Disappear"] is Animation disappear)
{
await appear.RunAsync(this);
await disappear.RunAsync(this);
}

Close();
}
Expand Down

0 comments on commit 5f9ec95

Please sign in to comment.