Skip to content

Fix for Rubjerg/Graphviz.NetWrapper 115#116

Merged
chtenb merged 2 commits intoRubjerg:masterfrom
modery:master
Feb 12, 2026
Merged

Fix for Rubjerg/Graphviz.NetWrapper 115#116
chtenb merged 2 commits intoRubjerg:masterfrom
modery:master

Conversation

@modery
Copy link
Contributor

@modery modery commented Feb 11, 2026

Introduces a null check to confirm that the directories, which are getting verified, are not null

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also checks for whitespace or empty strings, which is overly defensive. In fact, on list 44 we purposefully have an empty string as location, which resolves to the working directory of the process. I think we should only eliminate actual null values. Is that indeed enough to solve the issue you are encountering?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense. updated it to null check only

@chtenb chtenb merged commit 9eeabd3 into Rubjerg:master Feb 12, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants