Getting this error on stopping the game in Studio;
16:39:30.400 ReplicatedStorage.Modules.Zone.ZoneController.Tracker:135: attempt to index nil with 'item' - Server
16:39:30.400 Stack Begin - Studio
16:39:30.400 Script 'ReplicatedStorage.Modules.Zone.ZoneController.Tracker', Line 135 - Studio
16:39:30.400 Script 'ReplicatedStorage.Modules.Zone.Signal', Line 37 - function acquireRunnerThreadAndCallEventHandler - Studio
16:39:30.400 Script 'ReplicatedStorage.Modules.Zone.Signal', Line 48 - function runEventHandlerInFreeThread - Studio
16:39:30.400 Stack End - Studio
I believe it is linked to the fact that Zone:untrackItem cleans up itemDetail and then calls Fire on Tracker.itemRemoved:
function Zone:untrackItem(instance)
local itemDetail = self.trackedItems[instance]
if itemDetail then
itemDetail.janitor:destroy()
end
self.trackedItems[instance] = nil
local Tracker = require(trackerModule)
Tracker.itemRemoved:Fire(itemDetail)
end
This uses .item in the handler, which has been cleaned up:
Tracker.itemRemoved:Connect(function(itemDetail)
self.exitDetections[itemDetail.item] = nil
updateItem(itemDetail, nil)
end)
Getting this error on stopping the game in Studio;
I believe it is linked to the fact that
Zone:untrackItemcleans upitemDetailand then callsFireonTracker.itemRemoved:This uses
.itemin the handler, which has been cleaned up: