Skip to content

Commit

Permalink
Don't crash when the bucket is a non-existing file directory [#59]
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Nov 9, 2023
1 parent 926183a commit 6170acf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pmtiles/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ func OpenBucket(ctx context.Context, bucketURL string, bucketPrefix string) (Buc
return bucket, nil
} else {
bucket, err := blob.OpenBucket(ctx, bucketURL)
if err != nil {
return bucket, err

Check failure on line 117 in pmtiles/bucket.go

View workflow job for this annotation

GitHub Actions / test

cannot use bucket (variable of type *blob.Bucket) as Bucket value in return statement: *blob.Bucket does not implement Bucket (wrong type for method NewRangeReader)
}
if bucketPrefix != "/" && bucketPrefix != "." {
bucket = blob.PrefixedBucket(bucket, path.Clean(bucketPrefix)+string(os.PathSeparator))
}
Expand Down

0 comments on commit 6170acf

Please sign in to comment.