chocolatey / ChocolateyGUI

A delicious GUI for Chocolatey
https://docs.chocolatey.org/en-us/chocolatey-gui/
Apache License 2.0
1.61k stars 248 forks source link

(#1003) Handle null keys during source translation #1010

Closed AdmiringWorm closed 1 year ago

AdmiringWorm commented 1 year ago

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 ";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

Change Types Made

Change Checklist

Related Issue

Fixes #1003

gep13 commented 1 year ago

@AdmiringWorm thanks for getting this fixed up!

mattgyver-it commented 1 year ago

Thank you @AdmiringWorm