aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/laria/code
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/laria/code')
-rw-r--r--src/main/java/me/laria/code/idea_caseconv/SelectionReplacerAction.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/me/laria/code/idea_caseconv/SelectionReplacerAction.java b/src/main/java/me/laria/code/idea_caseconv/SelectionReplacerAction.java
index 088a1e2..d715ac2 100644
--- a/src/main/java/me/laria/code/idea_caseconv/SelectionReplacerAction.java
+++ b/src/main/java/me/laria/code/idea_caseconv/SelectionReplacerAction.java
@@ -33,8 +33,10 @@ abstract class SelectionReplacerAction extends AnAction {
public void actionPerformed(AnActionEvent anActionEvent) {
Editor editor = anActionEvent.getData(CommonDataKeys.EDITOR);
Project project = anActionEvent.getData(CommonDataKeys.PROJECT);
- assert editor != null;
- assert project != null;
+
+ if (editor == null || project == null) {
+ return;
+ }
CaretModel caretModel = editor.getCaretModel();
Document document = editor.getDocument();