fix null-pointer access (familiar spells)

This commit is contained in:
Enno Rehling 2021-08-06 09:59:56 +02:00
parent ae920edab0
commit 205cd6f491
1 changed files with 1 additions and 1 deletions

View File

@ -2581,7 +2581,7 @@ static castorder *cast_cmd(unit * u, order * ord)
skill = limit;
}
sp = unit_getspell(mage, s, mage->faction->locale);
if (sp->sptyp & NOTFAMILIARCAST) {
if (sp == NULL || sp->sptyp & NOTFAMILIARCAST) {
/* Fehler: "Diesen Spruch kann der Vertraute nicht zaubern" */
cmistake(u, ord, 177, MSG_MAGIC);
return 0;