summaryrefslogtreecommitdiffstats
path: root/sonar-deprecated
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-deprecated')
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java b/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java
index 4bb59509364..431fef44c10 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java
@@ -213,7 +213,7 @@ public class JavaFile extends Resource {
javaFile.setPath(normalizedPath);
javaFile.parent = new JavaPackage();
String directoryPath;
- if (normalizedPath.contains(Directory.SEPARATOR)) {
+ if (normalizedPath != null && normalizedPath.contains(Directory.SEPARATOR)) {
directoryPath = StringUtils.substringBeforeLast(normalizedPath, Directory.SEPARATOR);
} else {
directoryPath = Directory.SEPARATOR;