Skip to content

isDark throws an error and the app crashes if a color is set to NULL in the database #3764

Description

@iPurpl3x

Current Behavior

When a tag is saved in the database with the color column set to NULL, then when trying to display that tag in the UI, there will be an error as the isDark util will try to call replace on a null variable. The app crashes then because of this.

Steps to Reproduce

  1. Set the color column of a tag to NULL
  2. Open that tag index page

Expected Behavior

No error

Environment

  • Flarum version:1.7.1
  • PHP version: 8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions