From 03965113ac3fd40f32e103731b1fab9ed3ea77cd Mon Sep 17 00:00:00 2001 From: Blake Madden Date: Wed, 5 Oct 2022 16:27:44 -0400 Subject: [PATCH] Fix access violation by adding pointer check to GetType() --- src/wxSimpleJSON.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wxSimpleJSON.cpp b/src/wxSimpleJSON.cpp index 724dc91..89a2c32 100644 --- a/src/wxSimpleJSON.cpp +++ b/src/wxSimpleJSON.cpp @@ -364,7 +364,7 @@ bool wxSimpleJSON::HasProperty(const wxString& name) wxSimpleJSON::JSONType wxSimpleJSON::GetType() const { - return static_cast(m_d->type); + return (IsOk() ? static_cast(m_d->type) : JSONType::IS_INVALID); } wxArrayString wxSimpleJSON::GetObjectKeys(const wxMBConv &conv)