Skip to content

Commit 7e7cbfb

Browse files
fix: send to logbook fails if selection cannot be adapted
1 parent c2bfcaf commit 7e7cbfb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/menu/SendToLogBookApp.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public AppInstance create() {
4545
if(selection.getSelections().isEmpty()){
4646
ologLog = new OlogLog();
4747
}
48-
else{
49-
ologLog = AdapterService.adapt(selection.getSelections().get(0), LogEntry.class).get();
48+
else {
49+
ologLog = AdapterService
50+
.adapt(selection.getSelections().get(0), LogEntry.class)
51+
.orElse(new OlogLog());
5052
}
5153
new LogEntryEditorStage(ologLog).show();
5254
return null;

0 commit comments

Comments
 (0)