Skip to content

Unhandled exception when name or initials are blank #2

@mattbearman

Description

@mattbearman
Monogram.svg(name: ' ')

# => Infinity (FloatDomainError)

Same with name: '' and initials: '', however initials: ' ' will render an empty background.

nil values are handled in the lib, eg:

Monogram.svg(name: nil)

# => either `initials:` or `name:` must be specified (ArgumentError)

Although I'm not sure this is the best approach. I think the best would be to return an empty, completely transparent avatar image if there are no initials/name, and have a config option to raise an error instead, default transparent avatar

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions