Skip to content

Commit fadcb1e

Browse files
committed
Handle null "DisplayName" in registry
This is a backport of 0dabaa1 from PR #331 Fixes #330
1 parent 78cd4d2 commit fadcb1e

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

build/org.eclipse.cdt.build.gcc.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.cdt.build.gcc.core;singleton:=true
5-
Bundle-Version: 2.1.0.qualifier
5+
Bundle-Version: 2.1.1.qualifier
66
Bundle-Activator: org.eclipse.cdt.build.gcc.core.internal.Activator
77
Bundle-Vendor: %providerName
88
Require-Bundle: org.eclipse.core.runtime,

build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/Msys2ToolChainProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public void init(IToolChainManager manager) {
4848
for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
4949
String compKey = uninstallKey + '\\' + subkey;
5050
String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
51+
if (displayName == null) {
52+
continue;
53+
}
5154
if (on64bit) {
5255
if (MSYS2_64BIT_NAMES.contains(displayName)) {
5356
if (addToolChain64(manager, registry, compKey)) {

core/org.eclipse.cdt.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.cdt.core; singleton:=true
5-
Bundle-Version: 8.1.0.qualifier
5+
Bundle-Version: 8.1.1.qualifier
66
Bundle-Activator: org.eclipse.cdt.core.CCorePlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/MinGW.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ private static String findMinGWRoot(String envPathValue, String envMinGWHomeValu
9595
for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
9696
String compKey = uninstallKey + '\\' + subkey;
9797
String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
98+
if (displayName == null) {
99+
continue;
100+
}
98101
if (on64bit) {
99102
if (MSYS2_64BIT_NAMES.contains(displayName)) {
100103
String installLocation = registry.getCurrentUserValue(compKey, "InstallLocation"); //$NON-NLS-1$
@@ -230,6 +233,9 @@ private static String findMSysRoot(String envMinGWHomeValue) {
230233
for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
231234
String compKey = uninstallKey + '\\' + subkey;
232235
String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
236+
if (displayName == null) {
237+
continue;
238+
}
233239
if (on64bit) {
234240
if (MSYS2_64BIT_NAMES.contains(displayName)) {
235241
String home = registry.getCurrentUserValue(compKey, "InstallLocation"); //$NON-NLS-1$

0 commit comments

Comments
 (0)