Fix crash when pasting into directory without permissions (#2024)

This commit is contained in:
Joe Lim authored and GitHub committed 2025-07-02 11:08:24 +10:00
1 parent 0639e71171
commit e47b2fda08
2 files changed
+8 -9

No files matched your search

+1 -2
View File
@@ -104,8 +104,7 @@ func copyAll(srcs []string, dstDir string, preserve []string) (nums chan int64,
file := filepath.Base(src)
dst := filepath.Join(dstDir, file)
lstat, err := os.Lstat(dst)
if !os.IsNotExist(err) {
if lstat, err := os.Lstat(dst); err == nil {
ext := getFileExtension(lstat)
basename := file[:len(file)-len(ext)]
var newPath string