lib/db: New VersionList migration fixes (ref #6638) (#6705)

This commit is contained in:
Simon Frei 2020-06-02 23:05:41 +02:00 committed by GitHub
parent 79bf1f1056
commit fac4dec840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -731,7 +731,7 @@ func convertVersionList(vl VersionListDeprecated) (VersionList, error) {
break
}
oldPos++
if lastVersion.Equal(fv.Version) {
if len(newVl.RawVersions) > 0 && lastVersion.Equal(fv.Version) {
newVl.RawVersions[newPos].Devices = append(newVl.RawVersions[newPos].Devices, fv.Device)
continue
}
@ -747,6 +747,7 @@ func convertVersionList(vl VersionListDeprecated) (VersionList, error) {
if len(newVl.RawVersions) == 0 {
fv := vl.Versions[oldPos]
newVl.RawVersions = []FileVersion{newFileVersion(fv.Device, fv.Version, true, fv.Deleted)}
oldPos++
}
newPos = 0
outer: