Skip to content

Commit

Permalink
Added empty checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdas-infoblox committed Feb 23, 2024
1 parent 0c4dcfe commit 4a59ac3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions object_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ var getObjectWithSearchFieldsMap = map[string]func(recordType IBObject, objMgr *
if err != nil {
return nil, err
}
if newVal == nil || len(newVal) == 0 {
return nil, NewNotFoundError("record not found")
}
res = newVal
return res, err
},
Expand All @@ -151,6 +154,9 @@ var getObjectWithSearchFieldsMap = map[string]func(recordType IBObject, objMgr *
if err != nil {
return nil, err
}
if newVal == nil || len(newVal) == 0 {
return nil, NewNotFoundError("record not found")
}
res = newVal
return res, err
},
Expand All @@ -169,6 +175,9 @@ var getObjectWithSearchFieldsMap = map[string]func(recordType IBObject, objMgr *
if err != nil {
return nil, err
}
if newVal == nil || len(newVal) == 0 {
return nil, NewNotFoundError("record not found")
}
res = newVal
return res, err
},
Expand All @@ -187,6 +196,9 @@ var getObjectWithSearchFieldsMap = map[string]func(recordType IBObject, objMgr *
if err != nil {
return nil, err
}
if newVal == nil || len(newVal) == 0 {
return nil, NewNotFoundError("record not found")
}
res = newVal
return res, err

Expand Down

0 comments on commit 4a59ac3

Please sign in to comment.