CID 26257: Null pointer dereferences (NULL_RETURNS)

this test should never fire, but it shuts up coverity
This commit is contained in:
Enno Rehling 2015-10-29 16:40:18 +01:00
parent 9d9994811a
commit 833a1e70be

View file

@ -622,11 +622,13 @@ int sp_mindblast(struct castorder * co)
skill_t sk = random_skill(du, false); skill_t sk = random_skill(du, false);
if (sk != NOSKILL) { if (sk != NOSKILL) {
skill *sv = unit_skill(du, sk); skill *sv = unit_skill(du, sk);
if (sv) {
int n = 1 + rng_int() % 3; int n = 1 + rng_int() % 3;
reduce_skill(du, sv, n); reduce_skill(du, sv, n);
k += du->number; k += du->number;
} }
}
else { else {
/* unit has no skill. kill it. */ /* unit has no skill. kill it. */
kill_troop(dt); kill_troop(dt);