Merge pull request #143 from thegrb93/nil-check

Nil check
This commit is contained in:
CoreyLee Hassell 2018-09-03 04:09:11 -04:00 committed by GitHub
commit 0aa25c3706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -505,7 +505,7 @@ local function CreateConstraintFromTable(Constraint, EntityList, EntityTable, Pl
local ReEnableSecond
if(Constraint.BuildDupeInfo)then
if second ~= nil and not second:IsWorld() and Constraint.BuildDupeInfo.EntityPos ~= nil then
if first ~= nil and second ~= nil and not second:IsWorld() and Constraint.BuildDupeInfo.EntityPos ~= nil then
local SecondPhys = second:GetPhysicsObject()
if IsValid(SecondPhys) then
if not DontEnable then ReEnableSecond = SecondPhys:IsMoveable() end