1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-17 13:15:44 +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; private IBuildEnvironmentVariable path;
public static IPath getBinDir() { public static IPath getBinDir() {
IPath subPath = new Path("mingw\\bin"); IPath subPath = new Path("mingw\\bin");
// 1. Try the mingw directory in the platform install directory // 1. Try the mingw directory in the platform install directory
IPath installPath = new Path(Platform.getInstallLocation().getURL().getFile()); IPath installPath = new Path(Platform.getInstallLocation().getURL().getFile());
@ -71,7 +72,10 @@ public class MingwEnvironmentVariableSupplier implements
return binPath; return binPath;
// 3. Try looking if the mingw installer ran // 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", "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW",
"InstallLocation"); "InstallLocation");
if (mingwPath != null) { if (mingwPath != null) {