From 3982f12404a5dc0f3a626ccba9ed20c1d1b3c355 Mon Sep 17 00:00:00 2001 From: Mikolaj Zalewski Date: Thu, 4 Oct 2007 16:17:48 -0700 Subject: [PATCH] oleview: Don't crash if the parent type couldn't be retrieved. --- programs/oleview/typelib.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/programs/oleview/typelib.c b/programs/oleview/typelib.c index 1acdd84d6fb..355826b2f9e 100644 --- a/programs/oleview/typelib.c +++ b/programs/oleview/typelib.c @@ -895,14 +895,18 @@ static void CreateInterfaceInfo(ITypeInfo *pTypeInfo, int cImplTypes, WCHAR *wsz AddToTLDataStrW(pTLData, wszSpace); ITypeInfo_GetRefTypeOfImplType(pTypeInfo, 0, &hRefType); - ITypeInfo_GetRefTypeInfo(pTypeInfo, hRefType, &pRefTypeInfo); - ITypeInfo_GetDocumentation(pRefTypeInfo, MEMBERID_NIL, &bstrName, + if (SUCCEEDED(ITypeInfo_GetRefTypeInfo(pTypeInfo, hRefType, &pRefTypeInfo))) + { + ITypeInfo_GetDocumentation(pRefTypeInfo, MEMBERID_NIL, &bstrName, NULL, NULL, NULL); - AddToTLDataStrW(pTLData, bstrName); - AddToTLDataStrW(pTLData, wszSpace); + AddToTLDataStrW(pTLData, bstrName); + AddToTLDataStrW(pTLData, wszSpace); - SysFreeString(bstrName); - ITypeInfo_Release(pRefTypeInfo); + SysFreeString(bstrName); + ITypeInfo_Release(pRefTypeInfo); + } + else + AddToTLDataStrW(pTLData, wszFailed); } AddToTLDataStrW(pTLData, wszOpenBrackets3); AddToTLDataStrW(pTLData, wszNewLine);