DbCheckJob::_getCollectionMetadata() should check whether AutoGetDbForDbCheck::getDb() returns a null pointer in addition to checking whether Database::getCollection() returns a null pointer.
auto collection = agd.getDb()->getCollection(opCtx, info.nss); if (!collection) { return false; }