diff --git a/plugins/devkit/src/testAssistant/TestLocationDataRule.java b/plugins/devkit/src/testAssistant/TestLocationDataRule.java index 56fa658017be..0f4a71d9a19a 100644 --- a/plugins/devkit/src/testAssistant/TestLocationDataRule.java +++ b/plugins/devkit/src/testAssistant/TestLocationDataRule.java @@ -66,7 +66,7 @@ public class TestLocationDataRule implements GetDataRule { if (fileIndex.isInContent(file) && !fileIndex.isInSource(file) && !fileIndex.isInLibraryClasses(file)) { final VirtualFile parent = file.getParent(); final VirtualFile contentRoot = fileIndex.getContentRootForFile(file); - if (contentRoot != null) { + if (contentRoot != null && parent != null) { final String relativePath = VfsUtilCore.getRelativePath(parent, contentRoot, '/'); if (relativePath != null) { final PsiSearchHelper searchHelper = PsiSearchHelper.SERVICE.getInstance(project);