From 32935de85c2c196b10ba8bf750c36cd107e5ab10 Mon Sep 17 00:00:00 2001 From: Koda-Dog <koda@macwyver.de> Date: Fri, 31 Jan 2025 16:09:22 +0100 Subject: [PATCH] Update HomePage.xaml.cs Implement fallback for profile image URL when primary URL is empty --- AutoTrackR2/HomePage.xaml.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/AutoTrackR2/HomePage.xaml.cs b/AutoTrackR2/HomePage.xaml.cs index 4323248..dedbe3f 100644 --- a/AutoTrackR2/HomePage.xaml.cs +++ b/AutoTrackR2/HomePage.xaml.cs @@ -231,9 +231,10 @@ namespace AutoTrackR2 killGrid.Children.Add(killTextBlock); // Create the Image for the profile + string urlToUse = string.IsNullOrEmpty(killParts[7]) ? "https://cdn.robertsspaceindustries.com/static/images/account/avatar_default_big.jpg" : killParts[7]; var profileImage = new Image { - Source = new BitmapImage(new Uri(killParts[7])), // Assuming the 8th part contains the profile image URL + Source = new BitmapImage(new Uri(urlToUse)), // Assuming the 8th part contains the profile image URL Width = 90, Height = 90, Stretch = Stretch.Fill, // Adjust how the image fits @@ -357,9 +358,10 @@ namespace AutoTrackR2 killGrid.Children.Add(killTextBlock); // Create the Image for the profile + string urlToUse = string.IsNullOrEmpty(killParts[7]) ? "https://cdn.robertsspaceindustries.com/static/images/account/avatar_default_big.jpg" : killParts[7]; var profileImage = new Image { - Source = new BitmapImage(new Uri(killParts[7])), // Assuming the 8th part contains the profile image URL + Source = new BitmapImage(new Uri(urlToUse)), // Assuming the 8th part contains the profile image URL Width = 90, Height = 90, Stretch = Stretch.Fill, // Adjust how the image fits @@ -556,4 +558,4 @@ namespace AutoTrackR2 textBlock.FontSize = fontSize; } } -} +} \ No newline at end of file