Skip to content

type check allows nil #162

@Bastrabun

Description

@Bastrabun

https://github.com/mt-mods/mail/blob/f7cc435f6ba2b7aa82940b112880ad16e7efe0f3/api.lua#L25C1-L25C79

What this means is "Under what circumstances would this expression evaluate to no, that's not a string?:"

	if type(m.to or "") ~= "string" then return false, "'to' is not a string" end

If m.to is nil, then fallback "" is taken. Only if m.to is a table, bool or number this would return "not a string". Even if m.to is not nil but only "", where would it send to?

For my reference 7898

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions