Skip to content

EmailTemplates returns nil-padded slice #485

@lakhansamani

Description

@lakhansamani

Bug Description

In internal/graphql/email_templates.go:32-35, make([]*model.EmailTemplate, len(emailTemplates)) creates a slice with len nil elements, then append adds the actual data after those nil entries. The result has len nil entries followed by actual data.

Impact

LOW — API response contains nil entries before actual email template data.

Fix

Change to make([]*model.EmailTemplate, 0, len(emailTemplates)) to create a slice with 0 length but pre-allocated capacity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions