update from master
authorNiki Roo <niki@nikiroo.be>
Tue, 26 May 2020 19:36:10 +0000 (21:36 +0200)
committerNiki Roo <niki@nikiroo.be>
Tue, 26 May 2020 19:36:10 +0000 (21:36 +0200)
supported/Text.java

index 252aca0443fbfe0f71db294c0c8c1d3a816deb72..45d970a656322ef8e312f7cd6950a83123aedfe7 100644 (file)
@@ -227,9 +227,12 @@ class Text extends BasicSupport {
                @SuppressWarnings("resource") // cannot close, or we loose getInput()!
                Scanner scan = new Scanner(getInput(), "UTF-8");
                scan.useDelimiter("\\n");
-               scan.next(); // title
-               scan.next(); // author
-               scan.next(); // date or empty
+               if (scan.hasNext())
+                       scan.next(); // title
+               if (scan.hasNext())
+                       scan.next(); // author
+               if (scan.hasNext())
+                       scan.next(); // date or empty
                Boolean inChap = null;
                String line = "";
                while (scan.hasNext()) {