Merge pull request #192 from argonui/pickup-fix

Fix check for missing metadata in PlayArea onObjectPickup
This commit is contained in:
Chr1Z 2023-01-16 11:34:36 +01:00 committed by GitHub
commit 2e92953a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,7 +140,7 @@ function onObjectPickUp(player, object)
-- should be tracking
if showLocationLinks() and isInPlayArea(object) and object.getGMNotes() ~= nil and object.getGMNotes() ~= "" then
local pickedUpGuid = object.getGUID()
local metadata = JSON.decode(object.getGMNotes())
local metadata = JSON.decode(object.getGMNotes()) or { }
if (metadata.type == "Location") then
-- onCollisionExit sometimes comes 1 frame after onObjectPickUp (rather than before it or in
-- the same frame). This causes a mismatch in the data between dragging the on-table, and