Skip to content

Error with non existing key #1981

Closed
Closed

Description

@AlejandroCastillejo
  • I am trying to read a value in a json file but I cannot be sure that the variable exists in the file.

  • When I try to get the value of a non existing key it comes with an error and the program shuts down.
    I wonder if there if any way to check if a variable with this key exists in the file before reading it. So this way I could avoid he error.

Thank you for your help

Activity

  1. t-b commented on Mar 11, 2020

    @t-b
    Contributor
  2. AlejandroCastillejo commented on Mar 12, 2020

    @AlejandroCastillejo
    Author

    Thank you for your response.
    Now there is another Issue since I changed to the last version of the single include file.
    When I try to compile, there are some error messages like this:
    error: redefinition of ‘class nlohmann::json_pointer’
    class json_pointer

    Before I was using version 3.1.2. I updated it because this previous version does not include the 'contains' method.

    Thanks again for your help.

  3. nlohmann commented on Mar 13, 2020

    @nlohmann
    Owner

    In order to asses your issue, we need the following information:

    • What is the issue you have?

    • Please describe the steps to reproduce the issue. Can you provide a small but working code example?

    • What is the expected behavior?

    • And what is the actual behavior instead?

    • Which compiler and operating system are you using? Is it a supported compiler?

    • Did you use a released version of the library or the version from the develop branch?

    • If you experience a compilation error: can you compile and run the unit tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions