grailbio / base

A collection of Go utility packages used by GRAIL's tools
Apache License 2.0
86 stars 24 forks source link

Fix crashes in s3file.go #13

Closed tatatodd closed 4 years ago

tatatodd commented 4 years ago

Trivial fix for crashes like the following. I haven't tested, but I know it builds.

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc55174]

goroutine 579033 [running]: github.com/grailbio/base/file/s3file.newInfo(...) /Users/toddwang/go/pkg/mod/github.com/grailbio/base@v0.0.7/file/s3file/s3file.go:726 github.com/grailbio/base/file/s3file.(s3File).handleStat(0xc03ba87360, 0x2bd4760, 0xc03bd4d350, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc03be145a0) /Users/toddwang/go/pkg/mod/github.com/grailbio/base@v0.0.7/file/s3file/s3file.go:761 +0x424 github.com/grailbio/base/file/s3file.(s3File).handleRequests(0xc03ba87360) /Users/toddwang/go/pkg/mod/github.com/grailbio/base@v0.0.7/file/s3file/s3file.go:657 +0x1a7 created by github.com/grailbio/base/file/s3file.(*s3Impl).internalOpen /Users/toddwang/go/pkg/mod/github.com/grailbio/base@v0.0.7/file/s3file/s3file.go:457 +0x1f2