structurizr / java-extensions

Structurizr for Java extensions
Apache License 2.0
39 stars 23 forks source link

NullPointerException in RelationshipView when exporting Dynamic diagram #45

Closed jagregory closed 3 years ago

jagregory commented 3 years ago

CLI version 1.8.1

When I try to export a workspace to plantuml/structurizr which has a dynamic diagram, I get the exception below.

It seems to be related to there not being a null check on the following line: https://github.com/structurizr/java-extensions/blob/master/structurizr-plantuml/src/com/structurizr/io/plantuml/StructurizrPlantUMLWriter.java#L126

java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "com.structurizr.view.RelationshipView.isResponse()" is null
    at com.structurizr.io.plantuml.StructurizrPlantUMLWriter.lambda$write$9(StructurizrPlantUMLWriter.java:126)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at com.structurizr.io.plantuml.StructurizrPlantUMLWriter.write(StructurizrPlantUMLWriter.java:121)
    at com.structurizr.io.plantuml.PlantUMLWriter.write(PlantUMLWriter.java:168)
    at com.structurizr.io.plantuml.PlantUMLWriter.toString(PlantUMLWriter.java:117)
    at com.structurizr.cli.ExportCommand.run(ExportCommand.java:163)
    at com.structurizr.cli.StructurizrCliApplication.run(StructurizrCliApplication.java:47)
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:795)
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:779)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
    at com.structurizr.cli.StructurizrCliApplication.main(StructurizrCliApplication.java:80)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:109)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
simonbrowndotje commented 3 years ago

I've seen this with workspaces created by older versions of client libraries. Is that the case here, or are you using the DSL? If so, do you have an example DSL fragment?