Browse Source

Fixed physics bone crash: #20397

Andrea Catania 7 years ago
parent
commit
2e722caead
1 changed files with 8 additions and 0 deletions
  1. 8 0
      editor/spatial_editor_gizmos.cpp

+ 8 - 0
editor/spatial_editor_gizmos.cpp

@@ -1722,8 +1722,16 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
 		return;
 		return;
 
 
 	Skeleton *sk(physical_bone->find_skeleton_parent());
 	Skeleton *sk(physical_bone->find_skeleton_parent());
+	if (!sk)
+		return;
+
 	PhysicalBone *pb(sk->get_physical_bone(physical_bone->get_bone_id()));
 	PhysicalBone *pb(sk->get_physical_bone(physical_bone->get_bone_id()));
+	if (!pb)
+		return;
+
 	PhysicalBone *pbp(sk->get_physical_bone_parent(physical_bone->get_bone_id()));
 	PhysicalBone *pbp(sk->get_physical_bone_parent(physical_bone->get_bone_id()));
+	if (!pbp)
+		return;
 
 
 	Vector<Vector3> points;
 	Vector<Vector3> points;