Codechange: add non-nullptr asserts in cases where it should never be nullptr
Though where similar calls are checked for nullptr as in those instances of the use of that function it can actually return nullptr. In other words, write down the assumption that the function never returns nullptr in an assert.
This commit is contained in:
@@ -1464,6 +1464,9 @@ private:
|
||||
this->avails.push_back(c);
|
||||
} else {
|
||||
const GRFConfig *best = FindGRFConfig(c->ident.grfid, HasBit(c->flags, GCF_INVALID) ? FGCM_NEWEST : FGCM_NEWEST_VALID);
|
||||
/* Never triggers; FindGRFConfig returns either c, or a newer version of c. */
|
||||
assert(best != nullptr);
|
||||
|
||||
/*
|
||||
* If the best version is 0, then all NewGRF with this GRF ID
|
||||
* have version 0, so for backward compatibility reasons we
|
||||
|
Reference in New Issue
Block a user