Skip to content

Commit 7813c42

Browse files
authored
Merge pull request #130 from shjala/fix_panic_no_onboard_serial
Don't panic if there is no onboard cert
2 parents 05e757f + 2524166 commit 7813c42

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/driver/file/device_manager_file.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,9 @@ func (d *DeviceManager) checkValidOnboardSerial(cert *x509.Certificate, serial s
11371137
func (d *DeviceManager) getOnboardSerialDevice(cert *x509.Certificate, serial string) *uuid.UUID {
11381138
certStr := string(cert.Raw)
11391139
for uid, dev := range d.devices {
1140+
if dev.Onboard == nil {
1141+
continue
1142+
}
11401143
dCertStr := string(dev.Onboard.Raw)
11411144
if dCertStr == certStr && serial == dev.Serial {
11421145
return &uid

0 commit comments

Comments
 (0)