Skip to content

Commit 9fa0f31

Browse files
Fix bug when EMC doesn't have a balancing BMC/BDC (#707)
* Fix bug when EMC doesn't have a balancing BMC/BDC * Change error message in OperatorParser
1 parent 6a535b7 commit 9fa0f31

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

validation-model/src/main/java/org/verapdf/gf/model/factory/operators/OperatorParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void parseOperator(List<org.verapdf.model.operator.Operator> processedOperators,
191191
if (!this.markedContentStack.empty()) {
192192
this.markedContentStack.pop();
193193
} else {
194-
LOGGER.log(Level.WARNING, getErrorMessage("Operator (EMC) not inside marked content"));
194+
LOGGER.log(Level.WARNING, getErrorMessage("EMC operator does not have a balancing BMC/BDC operator"));
195195
}
196196
break;
197197
case Operators.MP:

wcag-validation/src/main/java/org/verapdf/gf/model/factory/chunks/ChunkParser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ public void parseChunk(Operator rawOperator, List<COSBase> arguments) {
106106
break;
107107
case Operators.EMC:
108108
processLineArts();
109-
markedContentStack.pop();
109+
if (!markedContentStack.isEmpty()) {
110+
markedContentStack.pop();
111+
} else {
112+
LOGGER.log(Level.WARNING, "EMC operator does not have a balancing BMC/BDC operator");
113+
}
110114
break;
111115
case Operators.G_FILL: {
112116
if (this.graphicsState.isProcessColorOperators()) {

0 commit comments

Comments
 (0)