From 850d57b39d5e6746e649a1d638274a20af0d770b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 8 Nov 2018 22:12:05 +0100 Subject: [PATCH 1/2] closes https://github.com/assimp/assimp/issues/2206: make bone error in verification more verbose. --- code/ValidateDataStructure.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/ValidateDataStructure.cpp b/code/ValidateDataStructure.cpp index ed6bde724..3bdae5166 100644 --- a/code/ValidateDataStructure.cpp +++ b/code/ValidateDataStructure.cpp @@ -491,8 +491,12 @@ void ValidateDSProcess::Validate( const aiMesh* pMesh) { if (pMesh->mBones[i]->mName == pMesh->mBones[a]->mName) { - ReportError("aiMesh::mBones[%i] has the same name as " - "aiMesh::mBones[%i]",i,a); + std::string name; + if (nullptr != pMesh->mBones[ i ]->mName.C_Str()) { + name = pMesh->mBones[ i ]->mName.C_Str(); + } + ReportError("aiMesh::mBones[%i], name = \"%s\" has the same name as " + "aiMesh::mBones[%i]", i, name, a ); } } } From e787604ff17c1e8280b6437d1bb7af72996b4c4f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 9 Nov 2018 11:54:12 +0100 Subject: [PATCH 2/2] Update ValidateDataStructure.cpp Integrate review findings. --- code/ValidateDataStructure.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ValidateDataStructure.cpp b/code/ValidateDataStructure.cpp index 3bdae5166..931c52822 100644 --- a/code/ValidateDataStructure.cpp +++ b/code/ValidateDataStructure.cpp @@ -491,7 +491,7 @@ void ValidateDSProcess::Validate( const aiMesh* pMesh) { if (pMesh->mBones[i]->mName == pMesh->mBones[a]->mName) { - std::string name; + const char *name = "unknown"; if (nullptr != pMesh->mBones[ i ]->mName.C_Str()) { name = pMesh->mBones[ i ]->mName.C_Str(); }