From 6ef22d4b0330733d2c00b2ffa34b8a53dca95da8 Mon Sep 17 00:00:00 2001 From: Andras Schaffer Date: Sat, 11 Dec 2021 01:07:12 +0100 Subject: [PATCH] Fix for canceling SITL version selection messagebox. ISSUE #2741 --- GCSViews/SITL.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GCSViews/SITL.cs b/GCSViews/SITL.cs index 0d32e2369e..d2af256c56 100644 --- a/GCSViews/SITL.cs +++ b/GCSViews/SITL.cs @@ -389,6 +389,9 @@ private async Task CheckandGetSITLImage(string filename) url = sitlroverstableurl; if (filename.ToLower().Contains("plane")) url = sitlplanestableurl; + } else + { + return null; } Uri fullurl = new Uri(url, filename); @@ -573,6 +576,10 @@ static string BraceMatch(string text, char braces, char bracee) private async void StartSITL(string exepath, string model, string homelocation, string extraargs = "", int speedup = 1) { + + //If we got null, it means that the verison selection box was canceled. + if (exepath == null) return; + if (String.IsNullOrEmpty(homelocation)) { CustomMessageBox.Show(Strings.Invalid_home_location, Strings.ERROR);