From 1c807ed415f5b01d35d287564394f782019ab2e4 Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Mon, 31 Jul 2017 18:25:31 +0300 Subject: [PATCH] Fix possible NPE when no spellchecking "EditorCustomization" provided --- .../src/com/intellij/openapi/vcs/ui/CommitMessage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/CommitMessage.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/CommitMessage.java index 7e9167c3c4df..461ac212a95b 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/CommitMessage.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/CommitMessage.java @@ -57,6 +57,7 @@ import java.util.Set; import static com.intellij.openapi.util.text.StringUtil.convertLineSeparators; import static com.intellij.openapi.util.text.StringUtil.trimTrailing; import static com.intellij.util.ObjectUtils.notNull; +import static com.intellij.util.containers.ContainerUtil.addIfNotNull; import static com.intellij.util.containers.ContainerUtil.newHashSet; import static com.intellij.util.ui.JBUI.Panels.simplePanel; import static com.intellij.vcs.commit.CommitMessageInspectionProfile.getBodyRightMargin; @@ -162,7 +163,7 @@ public class CommitMessage extends JPanel implements Disposable, DataProvider, C features.add(new InspectionCustomization(project)); } else { - features.add(SpellCheckingEditorCustomizationProvider.getInstance().getEnabledCustomization()); + addIfNotNull(features, SpellCheckingEditorCustomizationProvider.getInstance().getEnabledCustomization()); } EditorTextFieldProvider service = ServiceManager.getService(project, EditorTextFieldProvider.class);