1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-11 15:40:29 +01:00

Added null check in driver creation

This commit is contained in:
Rich Dunne 2020-10-01 05:52:44 -06:00
parent 4cb8c10569
commit 06777aa928

View file

@ -103,12 +103,19 @@ namespace SceneManager
{
GameFiber.Yield();
}
var driverBlip = v.Driver.AttachBlip();
driverBlip.Color = Color.Green;
driverBlip.Scale = 0.25f;
v.Driver.IsPersistent = true;
v.Driver.BlockPermanentEvents = true;
Logger.Log($"A missing driver was created for {v.Model.Name}.");
if(v && v.Driver)
{
var driverBlip = v.Driver.AttachBlip();
driverBlip.Color = Color.Green;
driverBlip.Scale = 0.25f;
v.Driver.IsPersistent = true;
v.Driver.BlockPermanentEvents = true;
Logger.Log($"A missing driver was created for {v.Model.Name}.");
}
else
{
return false;
}
}
return true;
}