forked from github/server
CID 26257: Null pointer dereferences (NULL_RETURNS)
this test should never fire, but it shuts up coverity
This commit is contained in:
parent
9d9994811a
commit
833a1e70be
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue