Skip to content

Fix null reference in ChipGroup, empty catch block in SingleLineInputField, hardcoded color in FloatingNavigationButton#793

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/identify-project-issues
Draft

Fix null reference in ChipGroup, empty catch block in SingleLineInputField, hardcoded color in FloatingNavigationButton#793
Copilot wants to merge 2 commits intomainfrom
copilot/identify-project-issues

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Description of Change

Project review identified three issues:

  • ChipGroup.csFirstOrDefault() result accessed via ! without null guard in both Single and Multi selection paths of SetChipsToggledBasedOnSelectedItems. Crashes when SelectedItems contains values not present in m_chipItems.
// Before: NullReferenceException if no matching chip
var chipItem = m_chipItems.FirstOrDefault(...);
chipItem!.Chip.IsToggled = true;

// After
var chipItem = m_chipItems.FirstOrDefault(...);
if (chipItem is null) return;
chipItem.Chip.IsToggled = true;
  • SingleLineInputField.cs — Empty catch (Exception e) {} in Focus() silently swallowed all errors. Now logs via DUILogService.LogError, consistent with the rest of the codebase.

  • FloatingNavigationButton.cs — Hardcoded Color.FromArgb("#BF8DCE") in two locations replaced with Colors.GetColor(ColorName.color_fill_highlight). Restores design system compliance and dark mode support.

Todos

  • I have tested on an Android device.
  • I have tested on an iOS device.
  • I have supported accessibility

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…Field, use design token in FloatingNavigationButton

Co-authored-by: Vetle444 <35739538+Vetle444@users.noreply.github.com>
Copilot AI changed the title [WIP] Review project to identify issues Fix null reference in ChipGroup, empty catch block in SingleLineInputField, hardcoded color in FloatingNavigationButton Feb 27, 2026
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.

2 participants