fedarovich / qbittorrent-net-client

qBittorrent client library for .Net
MIT License
35 stars 14 forks source link

Update PeerPartialData class to handle potential null values #26

Open Axeia opened 4 months ago

Axeia commented 4 months ago

I was getting some null exceptions in my code whilst using QBittorrent.GetPeerPartialDataSync upon further investigation I noticed that the properties of PeerPartialData.cs aren't declared as nullable. I believe they should be nullable as a server reply might as small as just the rid, for example: {"rid":55}.

This pull request makes all properties in the PeerPartialData class (except for ResponseId) nullable. This should make it clear to anyone utilising it that null values have to be handled where applicable.

This is just a quick edit/submission through the GitHub WebUI but only one file is affected, making things optionally nullable shouldn't lead to anything breaking.