From 5407fb00895bb32cf06e19fcee71031f4081c780 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 8 Mar 1999 12:12:04 +0000 Subject: [PATCH] check for declare != null in wantBraces git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@342 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/flow/CaseBlock.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jode/jode/flow/CaseBlock.java b/jode/jode/flow/CaseBlock.java index fde3a1e..d711be2 100644 --- a/jode/jode/flow/CaseBlock.java +++ b/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.