File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -136,12 +136,9 @@ func (idx *Index) FindLibraryUpdate(lib *libraries.Library) *Release {
136
136
if indexLib == nil {
137
137
return nil
138
138
}
139
- // library.Version is nil when when the version field in
140
- // a library descriptor is malformed and could not be parsed.
141
- if lib .Version == nil {
142
- return indexLib .Latest
143
- }
144
- if indexLib .Latest .Version .GreaterThan (lib .Version ) {
139
+ // If a library.properties has an invalid version property, usually empty or malformed,
140
+ // the latest available version is returned
141
+ if lib .Version == nil || indexLib .Latest .Version .GreaterThan (lib .Version ) {
145
142
return indexLib .Latest
146
143
}
147
144
return nil
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesinde
50
50
if installedLib .Location != libraries .User {
51
51
continue
52
52
}
53
- if installedLib .Version .Equal (indexLibrary .Version ) {
53
+ if installedLib .Version != nil && installedLib . Version .Equal (indexLibrary .Version ) {
54
54
return installedLib .InstallDir , nil , ErrAlreadyInstalled
55
55
}
56
56
replaced = installedLib
You can’t perform that action at this time.
0 commit comments