mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
NPE fixed
This commit is contained in:
@@ -70,7 +70,6 @@ public abstract class TextEditorBasedStructureViewModel implements StructureView
|
||||
}
|
||||
|
||||
protected TextEditorBasedStructureViewModel(final Editor editor) {
|
||||
LOG.assertTrue(editor != null);
|
||||
myEditor = editor;
|
||||
myCaretListener = new CaretListener() {
|
||||
public void caretPositionChanged(CaretEvent e) {
|
||||
@@ -103,6 +102,7 @@ public abstract class TextEditorBasedStructureViewModel implements StructureView
|
||||
}
|
||||
|
||||
public final Object getCurrentEditorElement() {
|
||||
if (myEditor == null) return null;
|
||||
final int offset = myEditor.getCaretModel().getOffset();
|
||||
PsiElement element = getPsiFile().findElementAt(offset);
|
||||
while (!isSutable(element)) {
|
||||
|
||||
Reference in New Issue
Block a user