You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this bug has not yet been reported by someone else
I have checked that this bug appears on Chrome
I have specified the version : 2022.3.9
I have specified my environment : Linux
Steps to reproduce
Create an empty diagram
Try to export it as SVG using the context menu in the explorer
Nothing happens from the user's point of view, but an exception is logged on the backend:
Caused by: java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:148) ~[na:na]
at org.eclipse.sirius.components.collaborative.diagrams.export.svg.DiagramExportService.computeViewBox(DiagramExportService.java:116) ~[classes/:na]
at org.eclipse.sirius.components.collaborative.diagrams.export.svg.DiagramExportService.addSvgRoot(DiagramExportService.java:78) ~[classes/:na]
at org.eclipse.sirius.components.collaborative.diagrams.export.svg.DiagramExportService.export(DiagramExportService.java:59) ~[classes/:na]
at org.eclipse.sirius.components.collaborative.diagrams.handlers.ExportDiagramEventHandler.handle(ExportDiagramEventHandler.java:51) ~[classes/:na]
Why would someone want to export an empty diagram? Here in the example scenario it's triggered manually, but it could be part of a programmatic export/publication of all the diagrams in a project for example.
The technical issue is here when the code does this.xBeginPositions.stream().min(Double::compare).get(); on lists like xBeginPositions that might be empty (which is the case on an empty diagram).
The text was updated successfully, but these errors were encountered:
Note that the "SonarLint for Eclipse" plug-in highlights this potential issue when opening the file (that's how I found it when looking for something else in that file).
Steps to reproduce
Why would someone want to export an empty diagram? Here in the example scenario it's triggered manually, but it could be part of a programmatic export/publication of all the diagrams in a project for example.
The technical issue is here when the code does
this.xBeginPositions.stream().min(Double::compare).get();
on lists likexBeginPositions
that might be empty (which is the case on an empty diagram).The text was updated successfully, but these errors were encountered: