- result.thenAccept(dnElements -> {
- try {
- openDiagram(display, dnElements);
- } catch (DatabaseException e) {
- LOGGER.error("Failed to open district network diagram with selection {}", dnElements);
+ result
+ .exceptionally(e -> Collections.emptyList())
+ .thenAccept(dnElements -> {
+ if (!dnElements.isEmpty()) {
+ try {
+ openDiagram(display, dnElements);
+ } catch (DatabaseException e) {
+ LOGGER.error("Failed to open district network diagram with selection {}", dnElements); //$NON-NLS-1$
+ }