mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 07:07:25 +08:00
fix directory lookup nil
This commit is contained in:
@@ -98,7 +98,7 @@ func (fs *FilerSink) CreateEntry(ctx context.Context, key string, entry *filer_p
|
||||
Name: name,
|
||||
}
|
||||
glog.V(1).Infof("lookup: %v", lookupRequest)
|
||||
if resp, err := client.LookupDirectoryEntry(ctx, lookupRequest); err == nil {
|
||||
if resp, err := client.LookupDirectoryEntry(ctx, lookupRequest); err == nil && resp.Entry != nil {
|
||||
if filer2.ETag(resp.Entry.Chunks) == filer2.ETag(entry.Chunks) {
|
||||
glog.V(0).Infof("already replicated %s", key)
|
||||
return nil
|
||||
@@ -153,6 +153,9 @@ func (fs *FilerSink) UpdateEntry(ctx context.Context, key string, oldEntry *file
|
||||
glog.V(0).Infof("lookup %s: %v", key, err)
|
||||
return err
|
||||
}
|
||||
if resp.Entry == nil {
|
||||
return filer2.ErrNotFound
|
||||
}
|
||||
|
||||
existingEntry = resp.Entry
|
||||
|
||||
|
Reference in New Issue
Block a user