From 5663f6402aeeb972df42f147c27090e3bd43e8bd Mon Sep 17 00:00:00 2001 From: Gargaj Date: Thu, 26 Dec 2024 15:41:30 +0100 Subject: [PATCH] fix crash if aspect ratio is not present --- BlueWP/Controls/Post/PostBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BlueWP/Controls/Post/PostBase.cs b/BlueWP/Controls/Post/PostBase.cs index 333607a..c017370 100644 --- a/BlueWP/Controls/Post/PostBase.cs +++ b/BlueWP/Controls/Post/PostBase.cs @@ -66,7 +66,7 @@ public int VideoHeight { return 100; } - int height = (int)(ActualWidth * PostVideo.aspectRatio.height / PostVideo.aspectRatio.width); + int height = PostVideo.aspectRatio == null ? 400 : (int)(ActualWidth * PostVideo.aspectRatio.height / PostVideo.aspectRatio.width); height = Math.Min(height, 400); return height; }