summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sources/scalac/Global.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java
index ece6ae14b5..c7b2001a33 100644
--- a/sources/scalac/Global.java
+++ b/sources/scalac/Global.java
@@ -264,7 +264,10 @@ public abstract class Global {
/** Reads and returns the source file in file with given name. */
public SourceFile getSourceFile(String filename) throws IOException {
- return getSourceFile(AbstractFile.open(null, filename));
+ AbstractFile file = AbstractFile.open(null, filename);
+ if (file == null) throw new FileNotFoundException(
+ "source file '" + filename + "' could not be found");
+ return getSourceFile(file);
}
/** Reads and returns the source file in given abstract file. */