Skip to content

Commit 9b5f580

Browse files
committed
2487: Add dispatch thread check before applying fix
Ensures that `applyFix` is only called on the dispatch thread to prevent potential threading issues. This change improves safety and aligns with IntelliJ threading requirements.
1 parent cb6e815 commit 9b5f580

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.intellij.codeInspection.LocalQuickFix;
99
import com.intellij.codeInspection.ProblemDescriptor;
10+
import com.intellij.openapi.application.ApplicationManager;
1011
import com.intellij.openapi.command.WriteCommandAction;
1112
import com.intellij.openapi.project.Project;
1213
import com.jetbrains.php.lang.psi.elements.StringLiteralExpression;
@@ -38,7 +39,9 @@ public void applyFix(
3839
) {
3940
final StringLiteralExpression expression =
4041
(StringLiteralExpression) descriptor.getPsiElement();
41-
applyFix(expression);
42+
if (ApplicationManager.getApplication().isDispatchThread()) {
43+
applyFix(expression);
44+
}
4245
}
4346

4447
private void applyFix(final StringLiteralExpression expression) {

0 commit comments

Comments
 (0)