Skip to content

Commit 49daa89

Browse files
[#549] Fix NPE in XpackUtils::getSysRepoBasePaths
1 parent d541eab commit 49daa89

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

  • plugins/org.eclipse.embedcdt.core/src/org/eclipse/embedcdt/core

plugins/org.eclipse.embedcdt.core/src/org/eclipse/embedcdt/core/XpackUtils.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,14 @@ public static IPath[] getRepoBasePaths() {
9696
// DEPRECATED
9797
public static IPath getSysRepoBasePath() {
9898

99-
Map<String, String> env = System.getenv();
100-
10199
if (EclipseUtils.isMacOSX()) {
102100
IPath path = new Path("/opt");
103101
return path;
104102
} else if (EclipseUtils.isLinux()) {
105103
IPath path = new Path("/opt");
106104
return path;
107105
} else if (EclipseUtils.isWindows()) {
108-
String progFolder = env.get("ProgramFiles");
106+
String progFolder = System.getenv("ProgramFiles");
109107
IPath path = new Path(progFolder);
110108
return path;
111109
}
@@ -114,8 +112,6 @@ public static IPath getSysRepoBasePath() {
114112

115113
public static IPath[] getSysRepoBasePaths() {
116114

117-
Map<String, String> env = System.getenv();
118-
119115
if (EclipseUtils.isMacOSX()) {
120116
IPath[] paths = new IPath[1];
121117
paths[0] = new Path("/opt");
@@ -126,7 +122,7 @@ public static IPath[] getSysRepoBasePaths() {
126122
return paths;
127123
} else if (EclipseUtils.isWindows()) {
128124
IPath[] paths = new IPath[1];
129-
String progFolder = env.get("ProgramFiles");
125+
String progFolder = System.getenv("ProgramFiles");
130126
paths[0] = new Path(progFolder);
131127
return paths;
132128
}

0 commit comments

Comments
 (0)