Skip to content

Commit 8a82dc0

Browse files
committed
Handle (even if theoretically impossible) nil result in library resolver
1 parent 9d90188 commit 8a82dc0

File tree

1 file changed

+3
-1
lines changed
  • arduino/libraries/librariesresolver

1 file changed

+3
-1
lines changed

Diff for: arduino/libraries/librariesresolver/cpp.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ func (resolver *Cpp) ResolveFor(header, architecture string) *libraries.Library
107107
// If more than one library qualifies use the "closestmatch" algorithm to
108108
// find the best matching one (instead of choosing it randomly)
109109
winner := findLibraryWithNameBestDistance(header, found)
110-
logrus.WithField("lib", winner.Name).Info(" library with the best mathing name")
110+
if winner != nil {
111+
logrus.WithField("lib", winner.Name).Info(" library with the best mathing name")
112+
}
111113
return winner
112114
}
113115

0 commit comments

Comments
 (0)