Skip to content

Fix index out of range error in renderXlsxTableMultiTarget by adding …#354

Merged
harp-intel merged 2 commits into
mainfrom
xlsxmultitarget
May 29, 2025
Merged

Fix index out of range error in renderXlsxTableMultiTarget by adding …#354
harp-intel merged 2 commits into
mainfrom
xlsxmultitarget

Conversation

@harp-intel
Copy link
Copy Markdown
Contributor

…a check for field existence

…a check for field existence

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel requested a review from Copilot May 28, 2025 18:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a safeguard in renderXlsxTableMultiTarget to prevent an index out-of-range panic by verifying that the Fields slice has elements before accessing it.

  • Adds a length check on Fields before using fieldIdx
  • Retains existing logic for extracting the first value if available

Comment thread internal/report/render_excel.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@harp-intel harp-intel merged commit c9972ab into main May 29, 2025
4 checks passed
@harp-intel harp-intel deleted the xlsxmultitarget branch May 29, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic when creating multi-target XLSX report when table from one target has no fields.

2 participants