mirror of https://github.com/apache/lucene.git
LUCENE-5945: don't hit NPE on trying to get root's fileName leading to strange test failure
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1625792 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d1ea8d1d92
commit
47e96510cc
|
@ -59,7 +59,7 @@ public abstract class TrecDocParser {
|
|||
*/
|
||||
public static ParsePathType pathType(Path f) {
|
||||
int pathLength = 0;
|
||||
while (f != null && ++pathLength < MAX_PATH_LENGTH) {
|
||||
while (f != null && f.getFileName() != null && ++pathLength < MAX_PATH_LENGTH) {
|
||||
ParsePathType ppt = pathName2Type.get(f.getFileName().toString().toUpperCase(Locale.ROOT));
|
||||
if (ppt!=null) {
|
||||
return ppt;
|
||||
|
|
Loading…
Reference in New Issue