Skip to content

Not existing value, crash #1065

Description

@DardanIljazi

Bug Report

  • When I get a json list (from server) and that a value I try to reach doesn't exist, the application crash

Feature Request

  • I think that this kind of things shouldn't happen (maybe an error, or maybe something returning nothing would be better)

What is the best solution in this cases ? (Check before trying to get value ?..)

Edit

I didn't notice that:

note operator[] implements unchecked access for const objects: If the given key is not present, the behavior is undefined (think of a dereferenced null pointer) and yields an assertion failure if assertions are switched on. If you are not sure whether an element in an object exists, use checked access with the at() function.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions