Skip to content

Commit

Permalink
Merge pull request #5 from bittorrent/feat/unixfs-mtime
Browse files Browse the repository at this point in the history
feat: linkfile mtime.
  • Loading branch information
mengcody authored Dec 6, 2024
2 parents 1343cef + b947f2e commit f4c1a3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linkfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Symlink struct {

func NewLinkFile(target string, stat os.FileInfo) File {
lf := &Symlink{Target: target, stat: stat}
if stat.ModTime() != (time.Time{}) {
if stat != nil && stat.ModTime() != (time.Time{}) {
lf.mtime = stat.ModTime()
}
lf.reader.Reset(lf.Target)
Expand Down

0 comments on commit f4c1a3b

Please sign in to comment.