From: Igor Kulaychuk Date: Wed, 19 Jul 2017 20:25:10 +0000 (+0300) Subject: Guard against children with nullptr ICorDebugValue X-Git-Tag: submit/tizen/20180620.071641~139 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44d70b80f89ea7a4bbfd66e12d25ff7db70b2f83;p=sdk%2Ftools%2Fnetcoredbg.git Guard against children with nullptr ICorDebugValue --- diff --git a/src/debug/netcoredbg/varobj.cpp b/src/debug/netcoredbg/varobj.cpp index e06e108..7898a7e 100644 --- a/src/debug/netcoredbg/varobj.cpp +++ b/src/debug/netcoredbg/varobj.cpp @@ -286,27 +286,30 @@ HRESULT ListChildren( std::vector members; - bool has_static_members; - bool has_more; - - IfFailRet(FetchFieldsAndProperties(objValue.value, - NULL, - pThread, - pILFrame, - members, - objValue.statics_only, - has_static_members, - childStart, - childEnd, - has_more)); - - if (!objValue.statics_only && has_static_members) + bool has_static_members = false; + bool has_more = false; + + if (objValue.value) { - objValue.value->AddRef(); - members.emplace_back(objValue.threadId, objValue.value); - } + IfFailRet(FetchFieldsAndProperties(objValue.value, + NULL, + pThread, + pILFrame, + members, + objValue.statics_only, + has_static_members, + childStart, + childEnd, + has_more)); + + if (!objValue.statics_only && has_static_members) + { + objValue.value->AddRef(); + members.emplace_back(objValue.threadId, objValue.value); + } - FixupInheritedFieldNames(members); + FixupInheritedFieldNames(members); + } PrintChildren(members, print_values, pILFrame, has_more, output);