Skip to content

Why is this a force unwrap ? My app just crashed  #1730

@adirburke

Description

@adirburke

return String(bytes: data, encoding: .utf8)!

I just had a
Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value

The function is throwing couldn't you throw a nil error instead of force-unwrap

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