Comments (8)
Thank you for report, I'll get to it in about 12 hours. If you can repair it faster (make sure to run code in the example case - file program.cs (I should make proper tests)), submit pull request and I'll approve it with my mobile.
Even if I added you as contributor, you won't be able to upload updated package to nuget. But maybe I could automate the package publishing.
from crapi-csharp-wrapper.
And one more thing, if you set breakpoint right after calling wrapper request (even if it throws exception), you can see wrapper.ServerResponse
, it contains api response (json).
from crapi-csharp-wrapper.
Thanks for your quick respond.
Turned out it was a small issue when there is no clan war for a clan, the stageEndTime was null.
The original code was (in ClanWarInfo.cs):
public int stageEndTime
{
get
{
return _warEndTime ?? _collectionEndTime.**Value**;
}
set { }
}
I updated the code to:
public int stageEndTime
{
get
{
return _warEndTime ?? _collectionEndTime**.GetValueOrDefault()**;
}
set { }
}
I got the issue fix reference to this link: https://stackoverflow.com/questions/10555682/nullable-object-must-have-a-value
I am very new to github and never submit push request. I will try to submit my code from my end, if it doesnot work, please try to update the code base on what I found.
Many thanks
from crapi-csharp-wrapper.
change Value to GetValueOrDefault()
from crapi-csharp-wrapper.
I didn't test it, but shouldn't be the type be int?
instead of int
? I don't know how it works right now, but maybe it should be nullable.
from crapi-csharp-wrapper.
I am not very sure, but I changed the type from int to int?, the issue was still there. Where I changed it to .GetValueOrDefault(), it worked.
To provide the default (null), or the value of the int column. Or you can specify the default with an overload. Either way, the nullable currently doesnt have a value, which is why you get that exception.
from crapi-csharp-wrapper.
Maybe this could be done with stageEndTime type int?
and the getter return _warEndTime ?? _collectionEndTime.Value ?? null
I'm not sure what the values are, so I don't know, this is just an idea. Do it to make it work, I don't really care how, or wait few hours and I'll make it myself.
from crapi-csharp-wrapper.
Thank you for your code, I've used it and the issue should be fixed in 2064410. I've uploaded the code to nuget and it should be available to download in few minutes.
If you want, you can write your code. I believe it should work if you download this repository, add new branch, change files and then create pull request. I recommend using GitHub Desktop application for windows, which offers simple GUI to work with repositories.
from crapi-csharp-wrapper.
Related Issues (18)
- Added wrapper to cr-api docs
- Can you update API that newer version contains battle times spent HOT 1
- missing three crown games data HOT 1
- Clan war data HOT 2
- the get player and chest are separated now HOT 2
- May I know what is the version of endpoint? HOT 1
- Request to add new features: Player Verification HOT 3
- OpenTournament properties are null HOT 1
- parameter for wr.SearchForTournament should be name HOT 1
- Collection was modified; enumeration operation may not execute HOT 2
- currentPlayers and maxPlayers are the same? HOT 4
- Player battles?
- More Api have been added HOT 2
- wr.GetOpenTournaments() hangs HOT 3
- please don't use cache HOT 2
- Simplified Clan is not what api model to be HOT 1
- How to get player's best season rank? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crapi-csharp-wrapper.