check for declare != null in wantBraces

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@342 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 154e7cf82e
commit 5407fb0089
  1. 3
      jode/jode/flow/CaseBlock.java

@ -94,7 +94,7 @@ public class CaseBlock extends StructuredBlock {
if (block == null)
return false;
for (;;) {
if (!block.declare.isEmpty()) {
if (block.declare != null && !block.declare.isEmpty()) {
/* A declaration; we need braces. */
return true;
}
@ -108,6 +108,7 @@ public class CaseBlock extends StructuredBlock {
StructuredBlock[] subBlocks = block.getSubBlocks();
if (subBlocks[0] instanceof InstructionBlock
&& subBlocks[0].declare != null
&& !subBlocks[0].declare.isEmpty()) {
/* An instruction block declares on the same level as
* the surrounding SequentialBlock.

Loading…
Cancel
Save