From b060c28e65d088076d63c43b541c71f9716a0eb4 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 4 Dec 2012 21:22:11 -0500 Subject: [PATCH] Fix crash when debug information wasn't available. --- .../value/value_nodes/BListValueNode.cpp | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/apps/debugger/value/value_nodes/BListValueNode.cpp b/src/apps/debugger/value/value_nodes/BListValueNode.cpp index 7302998198..91ea46f2b6 100644 --- a/src/apps/debugger/value/value_nodes/BListValueNode.cpp +++ b/src/apps/debugger/value/value_nodes/BListValueNode.cpp @@ -223,11 +223,17 @@ BListValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader, if (baseType->CountTemplateParameters() != 0) { // for BObjectList we need to walk up // the hierarchy: BObjectList -> _PointerList_ -> BList + if (baseType->CountBaseTypes() == 0) + return B_BAD_DATA; + baseType = dynamic_cast(baseType->BaseTypeAt(0) ->GetType()); if (baseType == NULL || baseType->Name() != "_PointerList_") return B_BAD_DATA; + if (baseType->CountBaseTypes() == 0) + return B_BAD_DATA; + baseType = dynamic_cast(baseType->BaseTypeAt(0) ->GetType()); if (baseType == NULL || baseType->Name() != "BList") @@ -303,14 +309,16 @@ BListValueNode::CreateChildren() if (fChildrenCreated) return B_OK; - BListItemCountNodeChild* countChild = new(std::nothrow) - BListItemCountNodeChild(fItemCountLocation, this, fItemCountType); + if (fItemCountType != NULL) { + BListItemCountNodeChild* countChild = new(std::nothrow) + BListItemCountNodeChild(fItemCountLocation, this, fItemCountType); - if (countChild == NULL) - return B_NO_MEMORY; + if (countChild == NULL) + return B_NO_MEMORY; - countChild->SetContainer(fContainer); - fChildren.AddItem(countChild); + countChild->SetContainer(fContainer); + fChildren.AddItem(countChild); + } BReference addressTypeRef; Type* type = NULL;