EADS-2669 : Create test block throws null pointer exception release701
authorShanil Amarasinghe <shanil@netbeans.org>
Fri, 25 May 2012 16:57:23 +0530
branchrelease701
changeset 231444acb912904
parent 230 b13b428b953d
child 232 da12dc5e8eec
EADS-2669 : Create test block throws null pointer exception
PLSQL/Execution/src/org/netbeans/modules/plsql/execution/CreateTestBlockAction.java
     1.1 --- a/PLSQL/Execution/src/org/netbeans/modules/plsql/execution/CreateTestBlockAction.java	Thu May 24 16:41:01 2012 +0530
     1.2 +++ b/PLSQL/Execution/src/org/netbeans/modules/plsql/execution/CreateTestBlockAction.java	Fri May 25 16:57:23 2012 +0530
     1.3 @@ -157,7 +157,7 @@
     1.4                          DataObject dataObj = null;
     1.5                          PlsqlBlock block = null;
     1.6                          List<PlsqlBlock> blocks = PlsqlParserUtil.findMatchingBlocks(PlsqlParserUtil.getBlockHierarchy(dataObject), doc, doc, selectedName, parentName, temp.getStartOffset(), false, false, true);
     1.7 -                        if (blocks != null) {
     1.8 +                        if (blocks != null && blocks.size() > 0) {
     1.9                              if (blocks.size() == 1) {
    1.10                                 block = blocks.get(0); 
    1.11                              } else {
    1.12 @@ -673,7 +673,7 @@
    1.13          List<PlsqlBlock> newBlockHier = PlsqlParserUtil.getBlockHierarchy(dataObj);
    1.14          PlsqlBlock block = null;
    1.15          List<PlsqlBlock> blocks = PlsqlParserUtil.findMatchingBlocks(newBlockHier, doc, specDoc, selectedName, parentName, offset, false, false, true);
    1.16 -        if (blocks != null) {
    1.17 +        if (blocks != null && blocks.size() > 0) {
    1.18              if (blocks.size() == 1) {
    1.19                  block = blocks.get(0);
    1.20              } else {