forked from github/server
CID 22552: Dereference before null check (REVERSE_INULL)
This commit is contained in:
parent
54304af182
commit
93b7bacff5
|
@ -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
|
* type->improvement==type means build another object of the same time
|
||||||
* while material lasts type->improvement==x means build x when type
|
* while material lasts type->improvement==x means build x when type
|
||||||
* is finished */
|
* is finished */
|
||||||
while (type->improvement != NULL &&
|
while (type && type->improvement &&
|
||||||
type->improvement != type &&
|
type->improvement != type &&
|
||||||
type->maxsize > 0 && type->maxsize <= completed) {
|
type->maxsize > 0 && type->maxsize <= completed) {
|
||||||
completed -= type->maxsize;
|
completed -= type->maxsize;
|
||||||
|
|
Loading…
Reference in New Issue