Code Monkey home page Code Monkey logo

Comments (8)

SoptikHa2 avatar SoptikHa2 commented on June 12, 2024

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.

SoptikHa2 avatar SoptikHa2 commented on June 12, 2024

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.

richagain avatar richagain commented on June 12, 2024

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.

richagain avatar richagain commented on June 12, 2024

change Value to GetValueOrDefault()

from crapi-csharp-wrapper.

SoptikHa2 avatar SoptikHa2 commented on June 12, 2024

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.

richagain avatar richagain commented on June 12, 2024

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.

SoptikHa2 avatar SoptikHa2 commented on June 12, 2024

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.

SoptikHa2 avatar SoptikHa2 commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.