Skip to content

Conversation

AdmiringWorm
Copy link
Member

Description Of Changes

The helper class that is used whe looking up any translations that has
been made did not handle the translation source strings when they
are null or empty. This causes problems when especially looking up
description of Chocolatey settings items that by some reason did
not have a description associated with themself in the configuration
file.

Motivation and Context

We should not throw any exceptions when looking up translations that could abort the entire execution of Chocolatey GUI.

Testing

Build a release version of Chocolatey GUI and run the following on a completely new system.

  1. Install Chocolatey v2.0.0 using normal installation on https://chocolatey.org/install
  2. Run `choco install chocolateygui --pre --source "<LOCATION_OF_BUILT_BINARY>;chocolatey"
  3. Open Chocolatey GUI as an administrator.
  4. Navigate to the settings page.
  5. Ensure an exception is not thrown, and will show Chocolatey settings that are missing a description.

Operating Systems Testing

  • Windows Server 2022
  • Windows 10

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Fixes #1003

The helper class that is used whe looking up any translations that has
been made did not handle the translation source strings when they
are null or empty. This causes problems when especially looking up
description of Chocolatey settings items that by some reason did
not have a description associated with themself in the configuration
file.
@AdmiringWorm AdmiringWorm self-assigned this Jun 7, 2023
@AdmiringWorm AdmiringWorm requested a review from gep13 June 7, 2023 13:14
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13 gep13 merged commit 4022954 into chocolatey:develop Jun 7, 2023
@gep13
Copy link
Member

gep13 commented Jun 7, 2023

@AdmiringWorm thanks for getting this fixed up!

@mattgyver-it
Copy link

Thank you @AdmiringWorm

@AdmiringWorm AdmiringWorm deleted the translating-null-values branch June 7, 2023 19:52
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.

Null reference exception is thrown when accessing the Chocolatey GUI settings screen
3 participants