diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-08-17 10:07:34 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-08-17 10:07:34 -0700 |
| commit | 4ccfdaeb4dd7a20c50414b1a3f5a4c37cacf6774 (patch) | |
| tree | 2787144ce5bfab94614451a408e736817afcd23d | |
| parent | 60158a23b3a2de8e8aa8ce1d16672adab2cc5540 (diff) | |
| download | seaweedfs-4ccfdaeb4dd7a20c50414b1a3f5a4c37cacf6774.tar.xz seaweedfs-4ccfdaeb4dd7a20c50414b1a3f5a4c37cacf6774.zip | |
prevent nil
| -rw-r--r-- | weed/filesys/meta_cache/meta_cache.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/filesys/meta_cache/meta_cache.go b/weed/filesys/meta_cache/meta_cache.go index 69a016c23..15ec0903d 100644 --- a/weed/filesys/meta_cache/meta_cache.go +++ b/weed/filesys/meta_cache/meta_cache.go @@ -61,7 +61,7 @@ func (mc *MetaCache) AtomicUpdateEntry(ctx context.Context, oldPath util.FullPat oldDir, _ := oldPath.DirAndName() if mc.visitedBoundary.HasVisited(util.FullPath(oldDir)) { if oldPath != "" { - if oldPath == newEntry.FullPath { + if newEntry != nil && oldPath == newEntry.FullPath { // skip the unnecessary deletion // leave the update to the following InsertEntry operation } else { |
