From 04bd3a7c14eb75543f3849b00d59342c5c16d45c Mon Sep 17 00:00:00 2001
From: Amorilia <amorilia@users.sourceforge.net>
Date: Mon, 19 Sep 2011 20:24:28 +0100
Subject: [PATCH] Fixed NiSkinInstance.FixLinks for NULL bones.

---
 change_log.txt             | 2 ++
 src/obj/NiSkinInstance.cpp | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/change_log.txt b/change_log.txt
index bfb4c9a5..8cdb8bf3 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -56,6 +56,8 @@ Version 0.7.3
 
 * Update to qhull 2011.1 (contributed by Cold Blood).
 
+* Fixed NiSkinInstance.FixLinks for NULL bones.
+
 Version 0.7.2
 =============
 
diff --git a/src/obj/NiSkinInstance.cpp b/src/obj/NiSkinInstance.cpp
index 1faedd6c..e8414f35 100644
--- a/src/obj/NiSkinInstance.cpp
+++ b/src/obj/NiSkinInstance.cpp
@@ -203,7 +203,9 @@ void NiSkinInstance::FixLinks( const map<unsigned int,NiObjectRef> & objects, li
 
 	//Ensure that bones have the flag set properly
 	for ( unsigned int i = 0; i < bones.size(); ++i ) {
-		bones[i]->SetSkinFlag(true);
+		if ( bones[i] != NULL ) {
+			bones[i]->SetSkinFlag(true);
+		}
 	}
 
 	//--END CUSTOM CODE--//
-- 
GitLab