Skip to content

Commit 290f9fd

Browse files
committed
Fixes after rebase
1 parent 5381834 commit 290f9fd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

ui/jetbrains/src/main/java/com/neueda/jetbrains/plugin/graphdb/jetbrains/actions/execute/ExecuteQueryPayload.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
import com.intellij.openapi.editor.Editor;
44
import org.jetbrains.annotations.NotNull;
55

6+
import java.util.Optional;
7+
68
public class ExecuteQueryPayload {
79

810
private final String content;
9-
1011
private final Editor editor;
1112

13+
public ExecuteQueryPayload(String content) {
14+
this.content = content;
15+
this.editor = null;
16+
}
17+
1218
public ExecuteQueryPayload(String content, Editor editor) {
1319
this.content = content;
1420
this.editor = editor;
@@ -20,8 +26,8 @@ public String getContent() {
2026
}
2127

2228
@NotNull
23-
public Editor getEditor() {
24-
return editor;
29+
public Optional<Editor> getEditor() {
30+
return Optional.ofNullable(editor);
2531
}
2632

2733
}

ui/jetbrains/src/main/java/com/neueda/jetbrains/plugin/graphdb/jetbrains/ui/console/graph/GraphPanelInteractions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void postResultReceived(ExecuteQueryPayload payload) {
6161
@Override
6262
public void handleError(ExecuteQueryPayload payload, Exception exception) {
6363
String errorMessage = exception.getMessage() == null ? "Error occurred" : "Error occurred: " + exception.getMessage();
64-
HintManager.getInstance().showErrorHint(payload.getEditor(), errorMessage);
64+
payload.getEditor().ifPresent(editor -> HintManager.getInstance().showErrorHint(editor, errorMessage));
6565

6666
visualization.stop();
6767
visualization.clear();

0 commit comments

Comments
 (0)