Skip to content

Commit af09169

Browse files
committed
Explicit check for existence of file
1 parent d2def98 commit af09169

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sbt-bridge/src/xsbt/DelegatingReporter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ public void doReport(MessageContainer cont, Context ctx) {
8080
SourceFile src = pos.source();
8181
position = new Position() {
8282
public Optional<java.io.File> sourceFile() {
83-
return Optional.ofNullable(src.file().file());
83+
if (src.exists()) return Optional.empty();
84+
else return Optional.of(src.file().file());
8485
}
8586
public Optional<String> sourcePath() {
86-
return Optional.ofNullable(src.file().path());
87+
if (src.exists()) return Optional.empty();
88+
else return Optional.of(src.file().path());
8789
}
8890
public Optional<Integer> line() {
8991
int line = pos.line();

0 commit comments

Comments
 (0)