[hg] main-silver: #232068: bail out if the document was cleared ...

  • From: Svata Dedic < >
  • To:
  • Subject: [hg] main-silver: #232068: bail out if the document was cleared ...
  • Date: Wed, 10 Jul 2013 23:36:01 -0700

changeset 36641d6c696a in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/36641d6c696a
description:
        #232068: bail out if the document was cleared from the editor already

diffstat:

 
editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/BraceMatchingSidebarComponent.java
 |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff --git 
a/editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/BraceMatchingSidebarComponent.java
 
b/editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/BraceMatchingSidebarComponent.java
--- 
a/editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/BraceMatchingSidebarComponent.java
+++ 
b/editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/BraceMatchingSidebarComponent.java
@@ -665,6 +665,10 @@
         int contentHeight;
         Rectangle visible = getVisibleRect();
         
+        BaseDocument bdoc = baseUI.getEditorUI().getDocument();
+        if (bdoc == null) {
+            return;
+        }
         try {
             int yPos = baseUI.getYFromPos(yFrom);
             tooltipYAnchor = yPos;
@@ -686,7 +690,6 @@
                     // and finally the suppression line:
                     contentHeight += lineHeight;
                     
-                    BaseDocument bdoc = baseUI.getEditorUI().getDocument();
                     int startAfterRelated = Utilities.getRowStart(bdoc, 
rel.getEnd().getOffset(), 1);
                     int startAtContext = Utilities.getRowStart(bdoc, yFrom);
                     // measure the indent so the view can align the ellipsis 

[hg] main-silver: #232068: bail out if the document was cleared ...

Svata Dedic 07/11/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 349 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close