Skip to content

Commit 18ef40c

Browse files
committed
Fix PlatformReference.String() method nil-pointer error
1 parent aaa0ce9 commit 18ef40c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arduino/cores/packagemanager/download.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ type PlatformReference struct {
3333
}
3434

3535
func (platform *PlatformReference) String() string {
36-
return platform.Package + ":" + platform.PlatformArchitecture + "@" + platform.PlatformVersion.String()
36+
res := platform.Package + ":" + platform.PlatformArchitecture
37+
if platform.PlatformVersion != nil {
38+
return res + "@" + platform.PlatformVersion.String()
39+
}
40+
return res
3741
}
3842

3943
// FindPlatform returns the Platform matching the PlatformReference or nil if not found.

0 commit comments

Comments
 (0)