summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/reasm/batch/Assembler.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/reasm/batch/Assembler.java b/src/main/java/org/reasm/batch/Assembler.java
index eec3dcb..5289e5b 100644
--- a/src/main/java/org/reasm/batch/Assembler.java
+++ b/src/main/java/org/reasm/batch/Assembler.java
@@ -57,8 +57,9 @@ public class Assembler {
// Create the main source file.
final Path path = Paths.get(args[0]);
- final SourceFile mainSourceFile = new SourceFile(new String(Files.readAllBytes(path), "UTF-8"), path.getFileName()
- .toString());
+ final Path fileName = path.getFileName();
+ final SourceFile mainSourceFile = new SourceFile(new String(Files.readAllBytes(path), "UTF-8"),
+ fileName == null ? "" : fileName.toString());
// Create a configuration.
final FileFetcher fileFetcher = new LocalFileFetcher(args[0]);