usage of whichpm in new gender code required a null ptr guard

This commit is contained in:
nhmall
2020-12-29 17:49:30 -05:00
parent 9c6a65f49b
commit 00c9277cfe

View File

@@ -2591,7 +2591,8 @@ struct _create_particular_data *d;
if (d->genderconf == -1) {
/* no confict exists between explicit gender term and
the specified monster name */
if (d->fem != -1 && !is_male(whichpm) && !is_female(whichpm))
if (d->fem != -1
&& (!whichpm || (!is_male(whichpm) && !is_female(whichpm))))
mmflags |= (d->fem == FEMALE) ? MM_FEMALE
: (d->fem == MALE) ? MM_MALE : 0;
} else {