From 7a79647bdbae76dc4fd4a92d048e02f176939665 Mon Sep 17 00:00:00 2001 From: Henri de Veer Date: Fri, 19 Jun 2026 10:59:16 +0200 Subject: [PATCH] Repair crash in 'Reports' --- EDSEditorGUI/Form1.cs | 10 +++++++++- EDSEditorGUI/style.css | 7 ++++++- libEDSsharp/NetworkPDOreport.cs | 10 +++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/EDSEditorGUI/Form1.cs b/EDSEditorGUI/Form1.cs index 1e9d0ca9..0c1b10c9 100644 --- a/EDSEditorGUI/Form1.cs +++ b/EDSEditorGUI/Form1.cs @@ -27,6 +27,7 @@ You should have received a copy of the GNU General Public License using System.IO; using libEDSsharp; using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using System.Diagnostics; namespace ODEditor { @@ -1038,7 +1039,14 @@ private void documentationToolStripMenuItem_Click(object sender, EventArgs e) docgenMarkup.genmddoc(temp2, dv.eds); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("cmd", $"/c start {temp2}")); + // By using "cmd /c start" you avoid the child process to be attached to the current + // process so the report viewer does not close when leaving the EDS editor. + // {temp2} is quoted too, so spaces in the path do not cause problems. + Process.Start(new ProcessStartInfo { + FileName = "cmd", + Arguments = $"/c start \"\" \"{temp2}\"", + WindowStyle= ProcessWindowStyle.Hidden + }); } if (IsRunningOnMono()) { diff --git a/EDSEditorGUI/style.css b/EDSEditorGUI/style.css index 934abd05..73c6e990 100644 --- a/EDSEditorGUI/style.css +++ b/EDSEditorGUI/style.css @@ -111,4 +111,9 @@ table tr:hover td { .receivers { width: 90%; -} \ No newline at end of file +} + +.error +{ + color: red; +} diff --git a/libEDSsharp/NetworkPDOreport.cs b/libEDSsharp/NetworkPDOreport.cs index d6108347..998d1c82 100644 --- a/libEDSsharp/NetworkPDOreport.cs +++ b/libEDSsharp/NetworkPDOreport.cs @@ -179,7 +179,15 @@ public void gennetpdodoc(string filepath, List network) } else { - name = eds.ods[index].Getsubobject(subindex).parameter_name; + ODentry current_sdo = eds.ods[index].Getsubobject(subindex); + if (current_sdo != null) + { + name = current_sdo.parameter_name; + } + else + { + name = string.Format("

Error: subindex is missing in SDO!

"); + } }