diff --git a/openpdf/src/main/java/com/lowagie/text/pdf/PdfPTable.java b/openpdf/src/main/java/com/lowagie/text/pdf/PdfPTable.java index df82d1539..90a5d899b 100644 --- a/openpdf/src/main/java/com/lowagie/text/pdf/PdfPTable.java +++ b/openpdf/src/main/java/com/lowagie/text/pdf/PdfPTable.java @@ -656,6 +656,9 @@ public PdfPCell addCell(String text) { * @param table the table to be added to the cell */ public PdfPCell addCell(PdfPTable table) { + if(table == this) { + throw new DocumentException("unable.to.add.self.to.table.contents"); + } defaultCell.setTable(table); addCell(defaultCell); defaultCell.setTable(null);