mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 05:06:29 +00:00
Fix null referent handling
This commit is contained in:
@@ -9,6 +9,10 @@ local Error = require(script.Parent.Error)
|
||||
local function decodeValue(virtualValue, instanceMap)
|
||||
-- Refs are represented as IDs in the same space that Rojo's protocol uses.
|
||||
if virtualValue.Type == "Ref" then
|
||||
if virtualValue.Value == nil then
|
||||
return true, nil
|
||||
end
|
||||
|
||||
local instance = instanceMap.fromIds[virtualValue.Value]
|
||||
|
||||
if instance ~= nil then
|
||||
|
||||
@@ -136,15 +136,21 @@ function applyDeferredRefs(instanceMap, deferredRefs, unappliedPatch)
|
||||
end
|
||||
|
||||
for _, entry in ipairs(deferredRefs) do
|
||||
local targetInstance = instanceMap.fromIds[entry.virtualValue.Value]
|
||||
local virtualValue = entry.virtualValue
|
||||
|
||||
if virtualValue.Value == nil then
|
||||
continue
|
||||
end
|
||||
|
||||
local targetInstance = instanceMap.fromIds[virtualValue.Value]
|
||||
if targetInstance == nil then
|
||||
markFailed(entry.id, entry.propertyName, entry.virtualValue)
|
||||
markFailed(entry.id, entry.propertyName, virtualValue)
|
||||
continue
|
||||
end
|
||||
|
||||
local ok = setProperty(entry.instance, entry.propertyName, targetInstance)
|
||||
if not ok then
|
||||
markFailed(entry.id, entry.propertyName, entry.virtualValue)
|
||||
markFailed(entry.id, entry.propertyName, virtualValue)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user