go-pmtiles icon indicating copy to clipboard operation
go-pmtiles copied to clipboard

Nil pointer check

Open tortuoise opened this issue 4 months ago • 1 comments

In line 188 of bucket.go, resp could be nil if the baseURL is nonsensical. Would be better if the dial tcp lookup : no such host error is propagated so that the user can correct the input.

	resp, err := b.client.Do(req)  
	if err != nil {  
		if resp != nil {  
			return nil, "", resp.StatusCode, err  
		} else {  
			return nil, "", http.StatusBadGateway, err  
		}  
	}  

Please let me know if a pull request would be merged.

tortuoise avatar Sep 16 '25 16:09 tortuoise

Can you please open a PR?

return nil, "", http.StatusBadGateway, err  

we need to return an integer for the 3rd arg, maybe just 0?

bdon avatar Sep 19 '25 09:09 bdon