Skip to content

Not existing value, crash #1065

@DardanIljazi

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.

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