diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/IfItem.java b/trunk/src/com/jpexs/decompiler/flash/graph/IfItem.java index 5c2046f79..e6ba6ac48 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/IfItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/IfItem.java @@ -52,13 +52,19 @@ public class IfItem extends GraphTargetItem implements Block { List ifBranch = onTrue; List elseBranch = onFalse; if (onTrue.isEmpty()) { - if (expr instanceof LogicalOpItem) { - expr = ((LogicalOpItem) expr).invert(); + if (onFalse.isEmpty()) { + if (expr instanceof NotItem) { + expr = ((NotItem) expr).getOriginal(); + } } else { - expr = new NotItem(null, expr); + if (expr instanceof LogicalOpItem) { + expr = ((LogicalOpItem) expr).invert(); + } else { + expr = new NotItem(null, expr); + } + ifBranch = onFalse; + elseBranch = onTrue; } - ifBranch = onFalse; - elseBranch = onTrue; } ret = hilight("if(") + expr.toString(localData) + hilight(")") + "\r\n{\r\n"; for (GraphTargetItem ti : ifBranch) {