Handle null "DisplayName" in registry

This is a backport of 0dabaa15fb
from PR #331

Fixes #330
This commit is contained in:
Jonah Graham 2023-03-19 14:34:33 -04:00
parent 78cd4d24e9
commit fadcb1e75b
4 changed files with 11 additions and 2 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.build.gcc.core;singleton:=true
Bundle-Version: 2.1.0.qualifier
Bundle-Version: 2.1.1.qualifier
Bundle-Activator: org.eclipse.cdt.build.gcc.core.internal.Activator
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime,

View file

@ -48,6 +48,9 @@ public class Msys2ToolChainProvider implements IToolChainProvider {
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)) {

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.core; singleton:=true
Bundle-Version: 8.1.0.qualifier
Bundle-Version: 8.1.1.qualifier
Bundle-Activator: org.eclipse.cdt.core.CCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -95,6 +95,9 @@ public class MinGW {
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$
@ -230,6 +233,9 @@ public class MinGW {
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$