Closed mksanger closed 2 months ago
When running put, I get
$ gocmd put -k [source] [destination] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x9be49a] goroutine 1 [running]: github.com/cyverse/gocommands/cmd/subcmd.(*PutCommand).requireEncryption(0xc0001d4340, {0x7ffecd34d65e, 0x34}, 0x14?, {0x0, 0x0}) /github/workspace/cmd/subcmd/put.go:291 +0xfa ...
The cause of this is that when filesystem.Stat returns an error, the returned targetEntry is nil. GetDir should be passed the original targetPath, rather than trying to get the path from targetEntry here.
filesystem.Stat
targetEntry
nil
GetDir
targetPath
Thank you for the fix!
When running put, I get
The cause of this is that when
filesystem.Stat
returns an error, the returnedtargetEntry
isnil
.GetDir
should be passed the originaltargetPath
, rather than trying to get the path fromtargetEntry
here.