Skip to content

Commit

Permalink
Handle null "DisplayName" in registry
Browse files Browse the repository at this point in the history
Fixes #330
  • Loading branch information
jonahgraham committed Mar 19, 2023
1 parent 2b297c4 commit 1f7525b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Expand Up @@ -48,6 +48,9 @@ public void init(IToolChainManager manager) {
for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
String compKey = uninstallKey + '\\' + subkey;
String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
if (displayName == null) {
continue;
}
if (on64bit) {
if (MSYS2_64BIT_NAMES.contains(displayName)) {
if (addToolChain64(manager, registry, compKey)) {
Expand Down
Expand Up @@ -95,6 +95,9 @@ private static String findMinGWRoot(String envPathValue, String envMinGWHomeValu
for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
String compKey = uninstallKey + '\\' + subkey;
String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
if (displayName == null) {
continue;
}
if (on64bit) {
if (MSYS2_64BIT_NAMES.contains(displayName)) {
String installLocation = registry.getCurrentUserValue(compKey, "InstallLocation"); //$NON-NLS-1$
Expand Down Expand Up @@ -230,6 +233,9 @@ private static String findMSysRoot(String envMinGWHomeValue) {
for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
String compKey = uninstallKey + '\\' + subkey;
String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
if (displayName == null) {
continue;
}
if (on64bit) {
if (MSYS2_64BIT_NAMES.contains(displayName)) {
String home = registry.getCurrentUserValue(compKey, "InstallLocation"); //$NON-NLS-1$
Expand Down

0 comments on commit 1f7525b

Please sign in to comment.