lib/protocol: Avoid panic in DeviceIDFromBytes (#6714)

This commit is contained in:
André Colomb
2020-06-07 10:31:12 +02:00
committed by GitHub
parent 607bcc0b0e
commit 46536509d7
9 changed files with 69 additions and 21 deletions
+5 -1
View File
@@ -264,7 +264,11 @@ func TestUpdate0to3(t *testing.T) {
t.Fatal(err)
}
if !ok {
t.Fatal("surprise missing global file", string(name), protocol.DeviceIDFromBytes(vl.Versions[0].Device))
device := "<invalid>"
if dev, err := protocol.DeviceIDFromBytes(vl.Versions[0].Device); err != nil {
device = dev.String()
}
t.Fatal("surprise missing global file", string(name), device)
}
e, ok := need[fi.FileName()]
if !ok {