emersion / go-webdav

A Go library for WebDAV, CalDAV and CardDAV
MIT License
326 stars 71 forks source link

nil check for multiGet pointless? #92

Closed mrusme closed 1 year ago

mrusme commented 2 years ago

I'm looking at the following code and I'm wondering whether it makes sense:

https://github.com/emersion/go-webdav/blob/13fa812f94c19e869d39b3610b06bfe9f42fda35/carddav/client.go#L308-L315

From what I see multiGet cannot be nil, because &multiGet.DataRequest would throw an invalid memory address / nil pointer error. Hence the check if multiGet == nil seems kind of pointless here.

Either that check should happen earlier or not at all, imho.