CID 22552: Dereference before null check (REVERSE_INULL)

This commit is contained in:
Enno Rehling 2015-10-30 12:37:27 +01:00
parent 54304af182
commit 93b7bacff5
1 changed files with 1 additions and 1 deletions

View File

@ -494,7 +494,7 @@ int build(unit * u, const construction * ctype, int completed, int want)
* type->improvement==type means build another object of the same time
* while material lasts type->improvement==x means build x when type
* is finished */
while (type->improvement != NULL &&
while (type && type->improvement &&
type->improvement != type &&
type->maxsize > 0 && type->maxsize <= completed) {
completed -= type->maxsize;