Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2008-06-10 10:26:55 +0000
committerAnton Leherbauer2008-06-10 10:26:55 +0000
commit95b4e724c86e59da6adf57f7d81e438e659337a5 (patch)
tree72b362b2930ed3dcb48080ea482f148b7127f955 /build/org.eclipse.cdt.managedbuilder.gnu.ui/src
parentac107ff7ab552a18b534babd8b6221751756b112 (diff)
downloadorg.eclipse.cdt-95b4e724c86e59da6adf57f7d81e438e659337a5.tar.gz
org.eclipse.cdt-95b4e724c86e59da6adf57f7d81e438e659337a5.tar.xz
org.eclipse.cdt-95b4e724c86e59da6adf57f7d81e438e659337a5.zip
Fix for 233866: NPE on Fresh installed Windows/CDT, patch by Enrico Ehrich <public@snipah.com>
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.gnu.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
index 752b796f84e..d0ab0c676b3 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
@@ -6,7 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Intel Corporation - Initial API and implementation
+ * Intel Corporation - Initial API and implementation
+ * Enrico Ehrich - http://bugs.eclipse.org/233866
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.gnu.cygwin;
@@ -134,11 +135,15 @@ public class CygwinPathResolver implements IBuildPathResolver {
String tail = EMPTY;
while (pattern.length() > 0) {
String key = REGISTRY_KEY + pattern;
- String s = user ?
- WindowsRegistry.getRegistry().getCurrentUserValue(key, PATH_NAME) :
- WindowsRegistry.getRegistry().getLocalMachineValue(key, PATH_NAME);
- if (s != null)
- return (s.concat(tail).replaceAll(BSLASH, SSLASH));
+ WindowsRegistry registry = WindowsRegistry.getRegistry();
+ if (null != registry) {
+ String s = user ?
+ registry.getCurrentUserValue(key, PATH_NAME) :
+ registry.getLocalMachineValue(key, PATH_NAME);
+
+ if (s != null)
+ return (s.concat(tail).replaceAll(BSLASH, SSLASH));
+ }
if (pattern.equals(ROOTPATTERN))
break; // no other paths to search
int pos = pattern.lastIndexOf(SLASH);

Back to the top