Merge pull request #53830 from juanvallejo/jvallejo/prevent-delta-fifo-store-panic

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

perform nil check before iterating over keys

**Release note**:
```release-note
NONE
```

Fixes panic due to nil pointer dereference 

Related downstream bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1377940
cc @smarterclayton
pull/6/head
Kubernetes Submit Queue 2017-10-13 09:43:13 -07:00 committed by GitHub
commit 8cbc9d7e27
1 changed files with 4 additions and 0 deletions

View File

@ -539,6 +539,10 @@ func (f *DeltaFIFO) Resync() error {
f.lock.Lock()
defer f.lock.Unlock()
if f.knownObjects == nil {
return nil
}
keys := f.knownObjects.ListKeys()
for _, k := range keys {
if err := f.syncKeyLocked(k); err != nil {