local function updateVehicle(frame)
local shouldTargetVehicle = UnitHasVehicleUI(frame.unit) and
- UnitTargetsVehicleInRaidUI(frame.unit) and UnitExists(frame.vehicle);
+ UnitTargetsVehicleInRaidUI(frame.unit) and frame.vehicle and UnitExists(frame.vehicle);
if shouldTargetVehicle then
if not frame.inVehicle then
frame.inVehicle = true;