studio-b12 / gowebdav

A golang WebDAV client library and command line tool.
BSD 3-Clause "New" or "Revised" License
309 stars 89 forks source link

Fix crash when no body is passed to `Client#req` #51

Closed zekroTJA closed 2 years ago

zekroTJA commented 2 years ago

Well, I noticed that a nil pointer panic is caused under some circumstances when Client#req is called with body as nil.
This PR should fix that problem.

Also, in order of the changes I've removed the nil check from the request inside the non-auth retry condition, because retryBuf is always nil when body was nil initially.

Additionally, I've added the .vscode/ directory to the gitignore, just for convenience when working with VSC.

chripo commented 2 years ago

thanks.