From 4f54226bd07b4b328953dd274d75b1df94e55d6d Mon Sep 17 00:00:00 2001 From: Rene Modery Date: Wed, 11 Feb 2026 17:43:26 +0800 Subject: [PATCH 1/2] Fix for Rubjerg/Graphviz.NetWrapper 115 --- Rubjerg.Graphviz/GraphvizCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rubjerg.Graphviz/GraphvizCommand.cs b/Rubjerg.Graphviz/GraphvizCommand.cs index ea04e92..e0becf2 100644 --- a/Rubjerg.Graphviz/GraphvizCommand.cs +++ b/Rubjerg.Graphviz/GraphvizCommand.cs @@ -43,8 +43,8 @@ internal static string Rid Path.GetDirectoryName(AppContext.BaseDirectory), "" ]; - return possibleLocations.Select(dir => Path.Combine(dir, "dot")).FirstOrDefault(File.Exists) - ?? possibleLocations.Select(dir => Path.Combine(dir, "dot.exe")).FirstOrDefault(File.Exists) + return possibleLocations.Where(d => !string.IsNullOrWhiteSpace(d)).Select(dir => Path.Combine(dir, "dot")).FirstOrDefault(File.Exists) + ?? possibleLocations.Where(d => !string.IsNullOrWhiteSpace(d)).Select(dir => Path.Combine(dir, "dot.exe")).FirstOrDefault(File.Exists) ?? throw new InvalidOperationException("Could not find path to dot binary in any of: " + string.Join(", ", possibleLocations)); }); internal static string DotExePath => _DotExePath.Value; From b0eae36ba16af7b913fe32c16c79f6134d6535c9 Mon Sep 17 00:00:00 2001 From: Rene Modery Date: Thu, 12 Feb 2026 17:47:00 +0800 Subject: [PATCH 2/2] Null check only --- Rubjerg.Graphviz/GraphvizCommand.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Rubjerg.Graphviz/GraphvizCommand.cs b/Rubjerg.Graphviz/GraphvizCommand.cs index e0becf2..022005b 100644 --- a/Rubjerg.Graphviz/GraphvizCommand.cs +++ b/Rubjerg.Graphviz/GraphvizCommand.cs @@ -43,8 +43,8 @@ internal static string Rid Path.GetDirectoryName(AppContext.BaseDirectory), "" ]; - return possibleLocations.Where(d => !string.IsNullOrWhiteSpace(d)).Select(dir => Path.Combine(dir, "dot")).FirstOrDefault(File.Exists) - ?? possibleLocations.Where(d => !string.IsNullOrWhiteSpace(d)).Select(dir => Path.Combine(dir, "dot.exe")).FirstOrDefault(File.Exists) + return possibleLocations.Where(d => d != null).Select(dir => Path.Combine(dir, "dot")).FirstOrDefault(File.Exists) + ?? possibleLocations.Where(d => d != null).Select(dir => Path.Combine(dir, "dot.exe")).FirstOrDefault(File.Exists) ?? throw new InvalidOperationException("Could not find path to dot binary in any of: " + string.Join(", ", possibleLocations)); }); internal static string DotExePath => _DotExePath.Value; @@ -129,3 +129,4 @@ public static (byte[] stdout, string stderr) Exec(Graph input, string format = " } } } +