[hg] main-silver: #232689: avoided NPE

  • From: Svata Dedic < >
  • To:
  • Subject: [hg] main-silver: #232689: avoided NPE
  • Date: Thu, 18 Jul 2013 15:52:06 -0700

changeset c92f792bc39d in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/c92f792bc39d
description:
        #232689: avoided NPE

diffstat:

 
editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/MasterMatcher.java
 |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff --git 
a/editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/MasterMatcher.java
 
b/editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/MasterMatcher.java
--- 
a/editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/MasterMatcher.java
+++ 
b/editor.bracesmatching/src/org/netbeans/modules/editor/bracesmatching/MasterMatcher.java
@@ -311,6 +311,9 @@
     }
     
     private Position[] toPositions(JTextComponent c, int[] offsets) throws 
BadLocationException {
+        if (offsets == null) {
+            return null;
+        }
         Position[] ret = new Position[offsets.length];
         for (int i = 0; i < ret.length; i++) {
             ret[i] = c.getDocument().createPosition(offsets[i]);

[hg] main-silver: #232689: avoided NPE

Svata Dedic 07/18/2013

Project Features

About this Project

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