Skip to content

Commit

Permalink
Some more nil pointer checks
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincalderfh committed Oct 27, 2021
1 parent 7bb1a96 commit f1e80d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/lockedresourcecontroller/locked-resource-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (lrm *LockedResourceManager) GetPatches() []lockedpatch.LockedPatch {

// SetResources set the resources to be enforced. Can be called only when the LockedResourceManager is stopped.
func (lrm *LockedResourceManager) SetResources(resources []lockedresource.LockedResource) error {
if lrm.stoppableManager.IsStarted() {
if lrm.stoppableManager != nil && lrm.stoppableManager.IsStarted() {
return errors.New("cannot set resources while enforcing is on")
}
err := lrm.validateLockedResources(resources)
Expand All @@ -87,7 +87,7 @@ func (lrm *LockedResourceManager) SetResources(resources []lockedresource.Locked

// SetPatches set the patches to be enforced. Can be called only when the LockedResourceManager is stopped.
func (lrm *LockedResourceManager) SetPatches(patches []lockedpatch.LockedPatch) error {
if lrm.stoppableManager.IsStarted() {
if lrm.stoppableManager != nil && lrm.stoppableManager.IsStarted() {
return errors.New("cannot set resources while enforcing is on")
}
// verifyPatchID Uniqueness
Expand Down

0 comments on commit f1e80d0

Please sign in to comment.