-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null reference exception is thrown when accessing the Chocolatey GUI settings screen #1003
Comments
I am able to reproduce this issue. |
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.
(#1003) Handle null keys during source translation
A new version of Chocolatey GUI (v2.1.0-alpha-20230608) has been released which aims to address this issue. You can find the release notes here: https://docs.chocolatey.org/en-us/chocolatey-gui/release-notes#alpha-20230608-june-8-2023 And the package here: https://community.chocolatey.org/packages/chocolateygui/2.1.0-alpha-20230608 You should be able to upgrade to this package version using:
If you could take this for a spin, and verify that the issue is now resolved, that would be very helpful. |
I upgraded the package, and settings loads fine now! Thanks!
|
@mattgyver-it thank you for confirming! |
Had the same issue but couldn't find this report. Adding keywords to make this issue easier to find. Keywords:
|
Previously, in this commit: chocolatey@da19356#diff-cb6a0471e41268b22a928bd57a59d51b70b7024e9beb30e89a330e193a089eba The usage of the top level CacheLocation and CommandExecutionTimeoutSeconds values had been removed, since these top level properties within the chocolatey.config had been replaced with values contained within the config section of the chocolatey.config file. However, the changes in that commit were too aggressive, and removed the call to the set_config_item (which has subsequently been renamed to SetConfigItem). The method call does the work of taking any value that is defined in the chocolatey.config for a given property name, and adding it to the ChocolateyConfiguration instance. When this method call was removed, it stopped setting the property value on the instance, and as a result, values that had been configured in the chocolatey.config file were ignored. They were still in play when the configuration was passed in via a command line option, but not when defining them in the chocolatey.config file. The removal of this call to the set_config_item method also explains why it was necessary to apply this bug fix in Chocolatey GUI: chocolatey/ChocolateyGUI#1003 The method call also had the effect of setting the description on the configuration value, which would have meant that Chocolatey GUI wouldn't have thrown a null reference exception. The change in Chocolatey GUI is still valid though, as there are times when a config value can have a missing description, so it makes sense to leave that fix in place.
Previously, in this commit: chocolatey@da19356#diff-cb6a0471e41268b22a928bd57a59d51b70b7024e9beb30e89a330e193a089eba The usage of the top level CacheLocation and CommandExecutionTimeoutSeconds values had been removed, since these top level properties within the chocolatey.config had been replaced with values contained within the config section of the chocolatey.config file. However, the changes in that commit were too aggressive, and removed the call to the set_config_item (which has subsequently been renamed to SetConfigItem). The method call does the work of taking any value that is defined in the chocolatey.config for a given property name, and adding it to the ChocolateyConfiguration instance. When this method call was removed, it stopped setting the property value on the instance, and as a result, values that had been configured in the chocolatey.config file were ignored. They were still in play when the configuration was passed in via a command line option, but not when defining them in the chocolatey.config file. The removal of this call to the set_config_item method also explains why it was necessary to apply this bug fix in Chocolatey GUI: chocolatey/ChocolateyGUI#1003 The method call also had the effect of setting the description on the configuration value, which would have meant that Chocolatey GUI wouldn't have thrown a null reference exception. The change in Chocolatey GUI is still valid though, as there are times when a config value can have a missing description, so it makes sense to leave that fix in place.
Previously, in this commit: chocolatey@da19356#diff-cb6a0471e41268b22a928bd57a59d51b70b7024e9beb30e89a330e193a089eba The usage of the top level CacheLocation and CommandExecutionTimeoutSeconds values had been removed, since these top level properties within the chocolatey.config had been replaced with values contained within the config section of the chocolatey.config file. However, the changes in that commit were too aggressive, and removed the call to the set_config_item (which has subsequently been renamed to SetConfigItem). The method call does the work of taking any value that is defined in the chocolatey.config for a given property name, and adding it to the ChocolateyConfiguration instance. When this method call was removed, it stopped setting the property value on the instance, and as a result, values that had been configured in the chocolatey.config file were ignored. They were still in play when the configuration was passed in via a command line option, but not when defining them in the chocolatey.config file. The removal of this call to the set_config_item method also explains why it was necessary to apply this bug fix in Chocolatey GUI: chocolatey/ChocolateyGUI#1003 The method call also had the effect of setting the description on the configuration value, which would have meant that Chocolatey GUI wouldn't have thrown a null reference exception. The change in Chocolatey GUI is still valid though, as there are times when a config value can have a missing description, so it makes sense to leave that fix in place.
Previously, in this commit: chocolatey@da19356#diff-cb6a0471e41268b22a928bd57a59d51b70b7024e9beb30e89a330e193a089eba The usage of the top level CacheLocation and CommandExecutionTimeoutSeconds values had been removed, since these top level properties within the chocolatey.config had been replaced with values contained within the config section of the chocolatey.config file. However, the changes in that commit were too aggressive, and removed the call to the set_config_item (which has subsequently been renamed to SetConfigItem). The method call does the work of taking any value that is defined in the chocolatey.config for a given property name, and adding it to the ChocolateyConfiguration instance. When this method call was removed, it stopped setting the property value on the instance, and as a result, values that had been configured in the chocolatey.config file were ignored. They were still in play when the configuration was passed in via a command line option, but not when defining them in the chocolatey.config file. The removal of this call to the set_config_item method also explains why it was necessary to apply this bug fix in Chocolatey GUI: chocolatey/ChocolateyGUI#1003 The method call also had the effect of setting the description on the configuration value, which would have meant that Chocolatey GUI wouldn't have thrown a null reference exception. The change in Chocolatey GUI is still valid though, as there are times when a config value can have a missing description, so it makes sense to leave that fix in place.
* release/2.1.0: (maint) Update to latest version of chocolatey.lib (maint) Update GRM configuration file (maint) Remove version bump in nuspec file (build) Use latest Chocolatey.Cake.Recipe package (maint) Switch to Http for variable names (#1014) Add advanced option to ignore cached items (#1014) Ignore cached files on forced outdated check (build) Make build files consistent with others (#993) (fix) Correct syntax in KTS file (#993) Add TC schedule trigger (maint) Fix StyleCop warnings (#980) Use assembly location when debugging (maint) Update to released alpha package (#1003) Handle null keys during source translation (#1005) Normalize version numbers (maint) Add banned api analyzer (maint) Remove usage of obsolete methods (maint) Update to latest Chocolatey.Lib package
🎉 This issue has been resolved in version 2.1.0 🎉 The release is available on: Your GitReleaseManager bot 📦🚀 |
Checklist
What You Are Seeing?
I just did a fresh install of Chocolatey 2.0.0 through powershell on Win 10 Home as an OSS user. I installed the ChocolateyGUI package. When I open ChocolateyGUI as admin, and click on Settings, it immediately throws the following NullException and then crashes.
What is Expected?
I expected to see the settings menu
How Did You Get This To Happen?
System Details
Installed Packages
Output Log
Additional Context
No response
The text was updated successfully, but these errors were encountered: