Fix possible nil pointer dereference (#13318)

This commit is contained in:
Eugene R
2021-12-02 15:23:41 +02:00
committed by GitHub
parent 6f77cef601
commit ed0eb3613c
2 changed files with 5 additions and 1 deletions

3
changelog/13318.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
identity: Fix possible nil pointer dereference.
```

View File

@@ -250,8 +250,9 @@ func (i *IdentityStore) Invalidate(ctx context.Context, key string) {
// storage entry is non-nil, its an indication of an update. In this
// case, entities in the updated bucket needs to be reinserted into
// MemDB.
entityIDs := make([]string, 0, len(bucket.Items))
var entityIDs []string
if bucket != nil {
entityIDs = make([]string, 0, len(bucket.Items))
for _, item := range bucket.Items {
entity, err := i.parseEntityFromBucketItem(ctx, item)
if err != nil {