Be explicit about nullptr checks.

Keep travis happy
This commit is contained in:
duncanspumpkin 2019-02-07 08:50:36 +00:00
parent 11c16955c5
commit 892d6dc5f7
2 changed files with 4 additions and 5 deletions

View File

@ -2248,9 +2248,8 @@ static void populate_vehicle_type_dropdown(Ride* ride)
bool selectionShouldBeExpanded; bool selectionShouldBeExpanded;
int32_t rideTypeIterator, rideTypeIteratorMax; int32_t rideTypeIterator, rideTypeIteratorMax;
if (gCheatsShowVehiclesFromOtherTrackTypes if (gCheatsShowVehiclesFromOtherTrackTypes
&& !( && !(ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE || ride->type == RIDE_TYPE_MINI_GOLF))
|| ride->type == RIDE_TYPE_MINI_GOLF))
{ {
selectionShouldBeExpanded = true; selectionShouldBeExpanded = true;
rideTypeIterator = 0; rideTypeIterator = 0;

View File

@ -76,7 +76,7 @@ public:
} }
Ride* ride = get_ride(_rideIndex); Ride* ride = get_ride(_rideIndex);
if (!ride || ride->type == RIDE_TYPE_NULL) if (ride == nullptr || ride->type == RIDE_TYPE_NULL)
{ {
log_warning("Invalid game command, ride_id = %u", _rideIndex); log_warning("Invalid game command, ride_id = %u", _rideIndex);
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE); return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
@ -116,7 +116,7 @@ public:
GameActionResult::Ptr Execute() const override GameActionResult::Ptr Execute() const override
{ {
Ride* ride = get_ride(_rideIndex); Ride* ride = get_ride(_rideIndex);
if (!ride) if (ride == nullptr)
{ {
log_warning("Invalid game command, ride_id = %u", _rideIndex); log_warning("Invalid game command, ride_id = %u", _rideIndex);
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE); return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);