nidi3 / graphviz-java

Use graphviz with pure java
Apache License 2.0
934 stars 107 forks source link

Not catch “IllegalArgumentException” when check GraphvizJdkEngine #222

Open ljr900723 opened 2 years ago

ljr900723 commented 2 years ago
private static GraalJavascriptEngine tryGraal() {
    try {
        return new GraalJavascriptEngine();
    } catch (ExceptionInInitializerError | NoClassDefFoundError | IllegalStateException e) {
        return null;
    }
}

The "tryGraal" method does not catch "IllegalArgumentException", which would be thrown in "requirePublicLanguage" method in "PolyglotEngineImpl" class.

As a result, the export process would crash when there is no "js" runtime in target machine.