Spellchecker: cover null case

This commit is contained in:
Olga Strizhenko
2018-02-13 17:29:50 +03:00
parent c7a99cb322
commit 8b2f7eeb0c
@@ -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();
}