Skip to content

Commit

Permalink
fix 'invalid memory address or nil pointer dereference' for namespace (
Browse files Browse the repository at this point in the history
…#4636)

Signed-off-by: 马洪贞 <[email protected]>
  • Loading branch information
hongzhen-ma authored Oct 18, 2024
1 parent 7665b2b commit 79c1343
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,10 @@ func (c *Controller) reconcileNamespaces(subnet *kubeovnv1.Subnet) error {
// 2. update namespaces
for _, expectNs := range expectNss {
checkNs, err := c.namespacesLister.Get(expectNs)
if err != nil && !k8serrors.IsNotFound(err) {
if err != nil {
if k8serrors.IsNotFound(err) {
continue
}
klog.Error(err)
return err
}
Expand Down

0 comments on commit 79c1343

Please sign in to comment.