Skip to content

Implement sanitization for custom colors array length #318

Description

@Kirtan-pc

Description

Custom colors are loaded from settings as an array of hex strings. If the custom color array is mutated to contain fewer or more than 3 elements (e.g., via manual file modification), the visualizer can fail to render correctly or throw exceptions due to undefined array indices.

Steps to Reproduce

  1. Manually edit themeProfiles.json and change the customColors array of a profile to contain only 1 color (e.g. ["#ff0000"]).
  2. Open Settings → Theme Profiles and load that profile.
  3. Observe the visualizer rendering or console logs.

Expected Behaviour

The colors array should be sanitized to ensure it contains exactly 3 valid hex strings, falling back to default colors if the structure is invalid.

Actual Behaviour

The array is loaded and passed directly to the renderer without length validation.

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