From 6cc2e919c0b597540d314824e88c823355184f61 Mon Sep 17 00:00:00 2001 From: Ayuka Date: Mon, 9 Aug 2021 13:14:59 -0500 Subject: [PATCH] Update nil Ref check and property decode warning to new Rojo protocol (#466) * Skip empty Refs in new Rojo protocol * Update warning message for new Rojo protocol --- plugin/src/Reconciler/decodeValue.lua | 2 +- plugin/src/Reconciler/diff.lua | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/src/Reconciler/decodeValue.lua b/plugin/src/Reconciler/decodeValue.lua index 321aae92..0fe7bf59 100644 --- a/plugin/src/Reconciler/decodeValue.lua +++ b/plugin/src/Reconciler/decodeValue.lua @@ -11,7 +11,7 @@ local function decodeValue(encodedValue, instanceMap) -- Refs are represented as IDs in the same space that Rojo's protocol uses. if ty == "Ref" then - if value == nil then + if value == "00000000000000000000000000000000" then return true, nil end diff --git a/plugin/src/Reconciler/diff.lua b/plugin/src/Reconciler/diff.lua index d146b308..14e04fb8 100644 --- a/plugin/src/Reconciler/diff.lua +++ b/plugin/src/Reconciler/diff.lua @@ -75,7 +75,9 @@ local function diff(instanceMap, virtualInstances, rootId) changedProperties[propertyName] = virtualValue end else - Log.warn("Failed to decode property of type {}", virtualValue.Type) + -- virtualValue can be empty in certain cases, and this may print out nil to the user. + local propertyType = next(virtualValue) + Log.warn("Failed to decode property of type {}", propertyType) end else local err = existingValueOrErr