Skip to content

Commit

Permalink
fix(client/functions): check if vehicle exists before querying if it …
Browse files Browse the repository at this point in the history
…is a vehicle (#124)
  • Loading branch information
Manason authored Sep 23, 2024
1 parent f83a711 commit 28ef445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function public.getVehicleInFront()
for i = 1, #raycastOffsetTable do
local vehicle = getVehicleInDirection(raycastOffsetTable[i]['fromOffset'], raycastOffsetTable[i]['toOffset'])

if IsEntityAVehicle(vehicle) then
if vehicle and DoesEntityExist(vehicle) and IsEntityAVehicle(vehicle) then
return vehicle
end
end
Expand Down

0 comments on commit 28ef445

Please sign in to comment.