mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-10 13:58:24 +01:00
fix directory lookup nil
This commit is contained in:
1 parent
e86da5a491
commit
7d10fdf737
8 files changed
+22
-8
No files matched your search
@@ -56,6 +56,9 @@ func (c *commandFsCat) Do(args []string, commandEnv *CommandEnv, writer io.Write
|
||||
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)
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ func (c *commandFsMetaCat) Do(args []string, commandEnv *CommandEnv, writer io.W
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if respLookupEntry.Entry == nil {
|
||||
return fmt.Errorf("file not found: %s", path)
|
||||
}
|
||||
|
||||
m := jsonpb.Marshaler{
|
||||
EmitDefaults: true,
|
||||
|
||||
@@ -65,7 +65,7 @@ func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer
|
||||
var targetDir, targetName string
|
||||
|
||||
// moving a file or folder
|
||||
if err == nil && respDestinationLookupEntry.Entry.IsDirectory {
|
||||
if err == nil && respDestinationLookupEntry.Entry!= nil && respDestinationLookupEntry.Entry.IsDirectory {
|
||||
// to a directory
|
||||
targetDir = filepath.ToSlash(filepath.Join(destinationDir, destinationName))
|
||||
targetName = sourceName
|
||||
|
||||
Reference in new issue
Block a user