Issue with my table

Hi, I made this table and function:

local playerDataCache = {}

--Data

local default = { isRedacted = nil, Icon = nil }

--Function to cache data

function CacheData(Player)

    local IsRedacted = Player:WaitForChild("IsRedacted")

    local IdealIcon = Player:WaitForChild("LeaderboardIcon")

    local IdealIconValue = IdealIcon.Value

    playerDataCache[Player.UserId] = default

    playerDataCache[Player.UserId].isRedacted = IsRedacted.Value

    if IdealIconValue ~= "None" then

        playerDataCache[Player.UserId].Icon = IconsModule.IdealIconValue

    end

    print(playerDataCache)

end

But the problem is, when I print it, it prints this:
{
[2908787387] = ▼ {
[“isRedacted”] = IsRedacted
}
}

It leaves out the icon, any ideas why?

When a value is set to nil, it pretty much doesn’t exist, so {isRedacted = nil, Icon = nil} is equal to {}. The reason it might be failing is that instead of setting .Icon to IdealIconValue you set it to IconsModule.IdealIconValue which may be nil.