convert and load fail with a java assert exception when input is null String.
For satefy we should consider null as an empty value that returns an empty document, for both convert and load.
java.lang.NullPointerException: reader
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at org.asciidoctor.jruby.internal.IOUtils.readFull(IOUtils.java:24)
at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convert(JRubyAsciidoctor.java:351)
at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convert(JRubyAsciidoctor.java:358)
at org.asciidoctor.jruby.ast.impl.SectionImplTest.temporal(SectionImplTest.java:28)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at
convert
andload
fail with a java assert exception when input isnull
String. For satefy we should considernull
as an empty value that returns an empty document, for bothconvert
andload
.In the case of convert with
Reader
I'd keep the current exception, at most, addObjects.requireNonNull(reader, "reader");
to https://github.com/asciidoctor/asciidoctorj/blob/b1902506e70db29bdd2fd5496f1f531e5fbccd13/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/internal/IOUtils.java#L22 so the users gets a hint of where the issue is without adding too much complexity.