From 29b0da34521a5f95fbcac4354ada1842054863e8 Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Tue, 11 Aug 2015 12:06:23 +0300 Subject: [PATCH] Refactoring to track what code is throwing NPE --- .../DetectedIndentOptionsNotificationProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/codeStyle/autodetect/DetectedIndentOptionsNotificationProvider.java b/platform/lang-impl/src/com/intellij/psi/codeStyle/autodetect/DetectedIndentOptionsNotificationProvider.java index f8a8915f3159..a1e7a3788ceb 100644 --- a/platform/lang-impl/src/com/intellij/psi/codeStyle/autodetect/DetectedIndentOptionsNotificationProvider.java +++ b/platform/lang-impl/src/com/intellij/psi/codeStyle/autodetect/DetectedIndentOptionsNotificationProvider.java @@ -116,12 +116,14 @@ public class DetectedIndentOptionsNotificationProvider extends EditorNotificatio if (!ApplicationManager.getApplication().isHeadlessEnvironment() || ApplicationManager.getApplication().isUnitTestMode() && myShowNotificationInTest) { - FileEditor fileEditor = FileEditorManager.getInstance(file.getProject()).getSelectedEditor(vFile); + Project project = file.getProject(); + FileEditorManager fileEditorManager = FileEditorManager.getInstance(project); + FileEditor fileEditor = fileEditorManager.getSelectedEditor(vFile); if (fileEditor != null) { Boolean notifiedFlag = fileEditor.getUserData(NOTIFIED_FLAG); if (notifiedFlag == null || enforce) { fileEditor.putUserData(NOTIFIED_FLAG, Boolean.TRUE); - EditorNotifications.getInstance(file.getProject()).updateNotifications(vFile); + EditorNotifications.getInstance(project).updateNotifications(vFile); } } }