Skip to content

Commit

Permalink
Fix access violation by adding pointer check to GetType()
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden authored and mtangoo committed Oct 7, 2022
1 parent f51c96a commit 0396511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wxSimpleJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ bool wxSimpleJSON::HasProperty(const wxString& name)

wxSimpleJSON::JSONType wxSimpleJSON::GetType() const
{
return static_cast<wxSimpleJSON::JSONType>(m_d->type);
return (IsOk() ? static_cast<wxSimpleJSON::JSONType>(m_d->type) : JSONType::IS_INVALID);
}

wxArrayString wxSimpleJSON::GetObjectKeys(const wxMBConv &conv)
Expand Down

0 comments on commit 0396511

Please # to comment.