From 800ebb64805bd3bcee0f8d2c15478baf838267de Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 18 Jul 2024 11:19:18 +0100 Subject: [PATCH] protondrive: fix nil pointer crash when when downloading native document file Fixes #7959 --- backend/protondrive/protondrive.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/protondrive/protondrive.go b/backend/protondrive/protondrive.go index 415db44a8..342cb34b5 100644 --- a/backend/protondrive/protondrive.go +++ b/backend/protondrive/protondrive.go @@ -883,7 +883,9 @@ func (o *Object) Storable() bool { // Open opens the file for read. Call Close() on the returned io.ReadCloser func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) { - fs.FixRangeOption(options, *o.originalSize) + if o.originalSize != nil { + fs.FixRangeOption(options, *o.originalSize) + } var offset, limit int64 = 0, -1 for _, option := range options { // if the caller passes in nil for options, it will become array of nil switch x := option.(type) {