Skip to content

Commit

Permalink
Handle case where map entry value is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
iain-macdonald committed Mar 11, 2024
1 parent 2a64a52 commit 05f9e29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions store/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,12 @@ func (m *idMap) add(ctx context.Context, p func(uint32) (releasable, error)) err
if i == 0 {
continue
}
e, ok := m.m[i]
e, _ := m.m[i]
releasable := false
if ok {
if e != nil {
releasable = e.releasable()
}
if !ok || releasable {
if e == nil || releasable {
if releasable {
log.G(ctx).Debugf("reusing ino %d because its releasable", i)
}
Expand Down

0 comments on commit 05f9e29

Please sign in to comment.