fix directory lookup nil

This commit is contained in:
Chris Lu
2020-02-25 11:13:06 -08:00
parent e86da5a491
commit 7d10fdf737
8 changed files with 22 additions and 8 deletions

View File

@@ -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