Permalink
Browse files

Avoid NREs after unsplitting buffer. Case 447306.

  • Loading branch information...
Tak committed Mar 22, 2012
1 parent 2597b3a commit d0d8eeaebc16e2ef715e10e8404423d27bc55957
@@ -81,7 +81,7 @@ public override void CursorPositionChanged ()
{
RemoveWidget ();
- if (Document.ParsedDocument != null) {
+ if (Document.ParsedDocument != null && Document.Editor != null && Document.Editor.Caret != null) {
DomLocation loc = new DomLocation (Document.Editor.Caret.Line, Document.Editor.Caret.Column);
RefactoringService.QueueQuickFixAnalysis (Document, loc, delegate(List<ContextAction> fixes) {
Application.Invoke (delegate {
@@ -270,8 +270,10 @@ static void DetachFromCurrentDoc ()
currentDoc.Closed -= HandleCurrentDocClosed;
if (currentDoc.Editor != null) {
- currentDoc.Editor.Document.TextReplaced -= BufferTextChanged;
- currentDoc.Editor.Caret.PositionChanged -= BufferCaretPositionChanged;
+ if (currentDoc.Editor.Document != null)
+ currentDoc.Editor.Document.TextReplaced -= BufferTextChanged;
+ if (currentDoc.Editor.Caret != null)
+ currentDoc.Editor.Caret.PositionChanged -= BufferCaretPositionChanged;
}
currentDoc = null;
}

0 comments on commit d0d8eea

Please sign in to comment.