aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_cat.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-07 16:51:46 -0800
committerChris Lu <chris.lu@gmail.com>2020-03-07 16:51:46 -0800
commit8645283a7b8a50485390267be9f83b83707f6161 (patch)
tree9e3e3f212d918e9fa7b0ac90b6ac9d9d687d0b56 /weed/shell/command_fs_cat.go
parent936e7cdbfb02e719058fa341772f2f8afee2a9f1 (diff)
downloadseaweedfs-8645283a7b8a50485390267be9f83b83707f6161.tar.xz
seaweedfs-8645283a7b8a50485390267be9f83b83707f6161.zip
fuse mount: avoid lookup nil entry
fix https://github.com/chrislusf/seaweedfs/issues/1221
Diffstat (limited to 'weed/shell/command_fs_cat.go')
-rw-r--r--weed/shell/command_fs_cat.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/weed/shell/command_fs_cat.go b/weed/shell/command_fs_cat.go
index 8364e0de1..3db487979 100644
--- a/weed/shell/command_fs_cat.go
+++ b/weed/shell/command_fs_cat.go
@@ -1,7 +1,6 @@
package shell
import (
- "context"
"fmt"
"io"
"math"
@@ -50,13 +49,10 @@ func (c *commandFsCat) Do(args []string, commandEnv *CommandEnv, writer io.Write
Name: name,
Directory: dir,
}
- respLookupEntry, err := client.LookupDirectoryEntry(context.Background(), request)
+ respLookupEntry, err := filer_pb.LookupEntry(client, request)
if err != nil {
return err
}
- if respLookupEntry.Entry == nil {
- return fmt.Errorf("file not found: %s", path)
- }
return filer2.StreamContent(commandEnv.MasterClient, writer, respLookupEntry.Entry.Chunks, 0, math.MaxInt32)