File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer/configuration Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -341,14 +341,19 @@ public static Project getProject(String path) {
341
341
if (env .hasProjects ()) {
342
342
final String lpath = path .replace (File .separatorChar , '/' );
343
343
for (Project p : env .getProjectList ()) {
344
- String pp = p .getPath ();
344
+ String projectPath = p .getPath ();
345
+ if (projectPath == null ) {
346
+ LOGGER .log (Level .WARNING , "Path of project {0} is not set" , p .getName ());
347
+ return null ;
348
+ }
349
+
345
350
// Check if the project's path is a prefix of the given
346
351
// path. It has to be an exact match, or the project's path
347
352
// must be immediately followed by a separator. "/foo" is
348
353
// a prefix for "/foo" and "/foo/bar", but not for "/foof".
349
- if (lpath .startsWith (pp )
350
- && (pp .length () == lpath .length ()
351
- || lpath .charAt (pp .length ()) == '/' )) {
354
+ if (lpath .startsWith (projectPath )
355
+ && (projectPath .length () == lpath .length ()
356
+ || lpath .charAt (projectPath .length ()) == '/' )) {
352
357
return p ;
353
358
}
354
359
}
You can’t perform that action at this time.
0 commit comments