Skip to content

Commit

Permalink
fix potential nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Omarabdul3ziz committed Jan 30, 2025
1 parent 1e64246 commit 9a7eb25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/netlight/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,13 @@ func (n *networker) SetPublicConfig(cfg pkg.PublicConfig) error {

func (n *networker) LoadPublicConfig() (pkg.PublicConfig, error) {
cfg, err := public.LoadPublicConfig()
return *cfg, err
if err != nil {
return pkg.PublicConfig{}, fmt.Errorf("failed to load public config: %w", err)
}
if cfg == nil {
return pkg.PublicConfig{}, fmt.Errorf("public config not found")
}
return *cfg, nil
}

func CreateNDMZBridge() (*netlink.Bridge, error) {
Expand Down

0 comments on commit 9a7eb25

Please sign in to comment.