Skip to content

Commit 9eeabd3

Browse files
authored
Fix for Rubjerg/Graphviz.NetWrapper 115 (#116)
1 parent e6bbd61 commit 9eeabd3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Rubjerg.Graphviz/GraphvizCommand.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ internal static string Rid
4343
Path.GetDirectoryName(AppContext.BaseDirectory),
4444
""
4545
];
46-
return possibleLocations.Select(dir => Path.Combine(dir, "dot")).FirstOrDefault(File.Exists)
47-
?? possibleLocations.Select(dir => Path.Combine(dir, "dot.exe")).FirstOrDefault(File.Exists)
46+
return possibleLocations.Where(d => d != null).Select(dir => Path.Combine(dir, "dot")).FirstOrDefault(File.Exists)
47+
?? possibleLocations.Where(d => d != null).Select(dir => Path.Combine(dir, "dot.exe")).FirstOrDefault(File.Exists)
4848
?? throw new InvalidOperationException("Could not find path to dot binary in any of: " + string.Join(", ", possibleLocations));
4949
});
5050
internal static string DotExePath => _DotExePath.Value;
@@ -129,3 +129,4 @@ public static (byte[] stdout, string stderr) Exec(Graph input, string format = "
129129
}
130130
}
131131
}
132+

0 commit comments

Comments
 (0)