Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-10-17 08:03:28 -0400
committerAndrey Loskutov2017-10-18 04:51:41 -0400
commitd8f2afcd4c949b369d37756c3b516e389cea20ca (patch)
tree64de8d8f442d55af2965a81f9e6e28e231425fed
parent2a70f6775a4d29c62ff1d675af84ffa7c69b98ec (diff)
downloadeclipse.platform.debug-I20171023-0800.tar.gz
eclipse.platform.debug-I20171023-0800.tar.xz
eclipse.platform.debug-I20171023-0800.zip
Change-Id: I95bec4d9f62613f25a94c2c3ea3e86df07918e6a Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
index 247eb9ba7..0078ad31e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
@@ -168,14 +168,20 @@ public class ToggleBreakpointAction extends Action implements IUpdate {
* @return the document or <code>null</code> if none
*/
private IDocument getDocument() {
- if (fDocument != null)
+ if (fDocument != null) {
return fDocument;
+ }
+
+ if (fPart == null) {
+ return null;
+ }
if (fPart instanceof ITextEditor) {
ITextEditor editor= (ITextEditor)fPart;
IDocumentProvider provider = editor.getDocumentProvider();
- if (provider != null)
+ if (provider != null) {
return provider.getDocument(editor.getEditorInput());
+ }
}
IDocument doc = fPart.getAdapter(IDocument.class);
@@ -186,9 +192,6 @@ public class ToggleBreakpointAction extends Action implements IUpdate {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
@Override
public void update() {
IDocument document= getDocument();

Back to the top