From 8b2f7eeb0c08cfa3714e05c0bcb6390d206478ae Mon Sep 17 00:00:00 2001 From: Olga Strizhenko Date: Fri, 2 Feb 2018 15:43:33 +0300 Subject: [PATCH] Spellchecker: cover null case --- .../spellchecker/SpellCheckerManager.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java b/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java index 9c2e5657eb3c..49c5c2a7e07f 100644 --- a/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java +++ b/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java @@ -218,19 +218,21 @@ public class SpellCheckerManager implements Disposable { final String transformed = spellChecker.getTransformation().transform(word); final EditableDictionary dictionary = DictionaryLevel.PROJECT == dictionaryLevel ? myProjectDictionary : myAppDictionary; if (transformed != null) { - UndoManager.getInstance(project).undoableActionPerformed(new BasicUndoableAction(file) { - @Override - public void undo() { - dictionary.removeFromDictionary(word); - restartInspections(); - } + if(file != null) { + UndoManager.getInstance(project).undoableActionPerformed(new BasicUndoableAction(file) { + @Override + public void undo() { + dictionary.removeFromDictionary(word); + restartInspections(); + } - @Override - public void redo() { - dictionary.addToDictionary(word); - restartInspections(); - } - }); + @Override + public void redo() { + dictionary.addToDictionary(word); + restartInspections(); + } + }); + } dictionary.addToDictionary(word); restartInspections(); }