1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

- fixed NPE on Linux

This commit is contained in:
Alena Laskavaia 2008-04-30 20:43:11 +00:00
parent 8d8ae63dbe
commit 8143e89a59

View file

@ -58,6 +58,7 @@ public class MingwEnvironmentVariableSupplier implements
private IBuildEnvironmentVariable path;
public static IPath getBinDir() {
IPath subPath = new Path("mingw\\bin");
// 1. Try the mingw directory in the platform install directory
IPath installPath = new Path(Platform.getInstallLocation().getURL().getFile());
@ -71,7 +72,10 @@ public class MingwEnvironmentVariableSupplier implements
return binPath;
// 3. Try looking if the mingw installer ran
String mingwPath = WindowsRegistry.getRegistry().getLocalMachineValue(
WindowsRegistry registry = WindowsRegistry.getRegistry();
if (registry==null) return null; // probably not even windows
String mingwPath = registry.getLocalMachineValue(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW",
"InstallLocation");
if (mingwPath != null) {