check for empty array

This commit is contained in:
Platinum 2020-07-25 16:13:52 -07:00
parent 49c9ca341d
commit 0fb2c09347
2 changed files with 1 additions and 1 deletions

View file

@ -129,7 +129,7 @@ namespace Rimworld_Animations {
else {
Quaternion addonRotation = quat;
if (AnimationSettings.controlGenitalRotation && pawnAnimator.controlGenitalAngle && ba?.hediffGraphics?[0]?.path != null && (ba.hediffGraphics[0].path.Contains("Penis") || ba.hediffGraphics[0].path.Contains("penis"))) {
if (AnimationSettings.controlGenitalRotation && pawnAnimator.controlGenitalAngle && ba?.hediffGraphics != null && ba.hediffGraphics.Count != 0 && ba.hediffGraphics[0]?.path != null && (ba.hediffGraphics[0].path.Contains("Penis") || ba.hediffGraphics[0].path.Contains("penis"))) {
addonRotation = Quaternion.AngleAxis(angle: pawnAnimator.genitalAngle, axis: Vector3.up);
}