Skip to content

Callback Error #5

@Legacy-TacticalGamingInteractive

Description

I am getting this server sided error in console:

[     script:loaf_lib] SCRIPT ERROR: @loaf_lib/server/functions/logs.lua:23: attempt to index a nil value (local 'text')
[     script:loaf_lib] > userCallback (@loaf_lib/server/functions/logs.lua:23)

local function GetPlayerPicture(source)
    if not GetPlayerName(source) then return false end

    local steam = GetIdentifier(source, "steam")
    if not steam then
        return false
    end
    local url
    PerformHttpRequest("https://steamcommunity.com/profiles/" .. tonumber(steam, 16), function(_, text, _) 
        if not text then url = false end
        url = text:match('<meta name="twitter:image" content="(.-)"')  <--------------------
    end, "GET")
    while url == nil do
        Wait(0)
    end
    return url
end

Is there a way to fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions