From 8d11730326fb2d9fb7281079a36c735e391a1cfd Mon Sep 17 00:00:00 2001 From: Eusebiu Marcu Date: Thu, 4 Aug 2011 17:45:24 +0200 Subject: [PATCH] fix bug when SD tried to display the source file that not exists (e.g. the symbols are present but the sources aren't - see Prism). --- .../Services/Debugger/CurrentLineBookmark.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs b/src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs index 6235fbdb84..6a34d81c38 100644 --- a/src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs +++ b/src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs @@ -29,13 +29,16 @@ namespace ICSharpCode.SharpDevelop.Debugging SetPosition(tecp.TextEditor.FileName, tecp.TextEditor.Document, markerStartLine, markerStartColumn, markerEndLine, markerEndColumn); } else { lock (syncObject) { - dynamic codeView = viewContent.Control; - var document = codeView.TextEditor.Document as IDocument; - SetPosition(codeView.Adapter.FileName, document, markerStartLine, markerStartColumn, markerEndLine, markerEndColumn); - codeView.IconBarManager.Bookmarks.Add(CurrentLineBookmark.instance); - codeView.UnfoldAndScroll(markerStartLine); - if (document != null) - CurrentLineBookmark.instance.Document = document; + // get the decompiled view if exists + if (viewContent != null && viewContent.Control != null) { + dynamic codeView = viewContent.Control; + var document = codeView.TextEditor.Document as IDocument; + SetPosition(codeView.Adapter.FileName, document, markerStartLine, markerStartColumn, markerEndLine, markerEndColumn); + codeView.IconBarManager.Bookmarks.Add(CurrentLineBookmark.instance); + codeView.UnfoldAndScroll(markerStartLine); + if (document != null) + CurrentLineBookmark.instance.Document = document; + } } } }