mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 10:18:54 +00:00
Nill value when vehicle is missing on vehicle list
Fixed error "attempt to index a nil value (local 'firstVehicleData')" when vehicle doesn't exist on vehicle list/database.
This commit is contained in:
committed by
GitHub
parent
e4a083e2d7
commit
f510277ba0
+14
-12
@@ -705,20 +705,22 @@ AddEventHandler('esx_vehicleshop:hasEnteredMarker', function(zone)
|
||||
end
|
||||
end
|
||||
|
||||
resellPrice = ESX.Math.Round(vehicleData.price / 100 * Config.ResellPercentage)
|
||||
model = GetEntityModel(vehicle)
|
||||
plate = ESX.Math.Trim(GetVehicleNumberPlateText(vehicle))
|
||||
if vehicleData then
|
||||
resellPrice = ESX.Math.Round(vehicleData.price / 100 * Config.ResellPercentage)
|
||||
model = GetEntityModel(vehicle)
|
||||
plate = ESX.Math.Trim(GetVehicleNumberPlateText(vehicle))
|
||||
|
||||
CurrentAction = 'resell_vehicle'
|
||||
CurrentActionMsg = _U('sell_menu', vehicleData.name, ESX.Math.GroupDigits(resellPrice))
|
||||
CurrentAction = 'resell_vehicle'
|
||||
CurrentActionMsg = _U('sell_menu', vehicleData.name, ESX.Math.GroupDigits(resellPrice))
|
||||
|
||||
CurrentActionData = {
|
||||
vehicle = vehicle,
|
||||
label = vehicleData.name,
|
||||
price = resellPrice,
|
||||
model = model,
|
||||
plate = plate
|
||||
}
|
||||
CurrentActionData = {
|
||||
vehicle = vehicle,
|
||||
label = vehicleData.name,
|
||||
price = resellPrice,
|
||||
model = model,
|
||||
plate = plate
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user