Skip to content

Commit caf5de2

Browse files
committed
fix nil pointer
1 parent 9fc8edb commit caf5de2

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

configdb/configdb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ func getSAG(sag *values.SAG, version *v.Version) (*SAG, error) {
502502
return nil, fmt.Errorf("sag configuration only works with sonic versions from the ec202211 branch")
503503
}
504504

505-
if sag.MAC == "" {
505+
if sag == nil || sag.MAC == "" {
506506
return nil, nil
507507
}
508508

tests/2/sonic-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ ports:
4848
- name: Ethernet48
4949
vrf: Vrf42
5050

51-
sag: {}
52-
5351
vlans:
5452
- id: 4000
5553
dhcp_servers:

0 commit comments

Comments
 (0)