weiyeh/iText-4.2.0 — pull request #1 by glarfs (2013-05-24 09:20:27+00:00)
Title: nullpointer bug on PdfPTable and PdfPCell

details
com/lowagie.text.pdf.PdfPTable.java
line: 868:
original:
```java
if (cell.getRowspan() == rs + 1) {
```
changed by:
```java
if (cell != null && cell.getRowspan() == rs + 1) {
```
exception produced:
```
com.lowagie.text.DocumentException: java.lang.NullPointerException
at com.lowagie.text.pdf.PdfDocument.add(PdfDocument.java:772)
at com.lowagie.text.Document.add(Document.java:285)
at isf.util.converter.HSSFExcelToPdfConverter.browseHSSFSheet(HSSFExcelToPdfConverter.java:323)
at isf.util.converter.HSSFExcelToPdfConverter.convert(HSSFExcelToPdfConverter.java:181)
at isf.util.converter.ExcelToPdfConverterFactory.convert(ExcelToPdfConverterFactory.java:119)
at isf.util.converter.HSSFExcelToPdfConverterTest.test(HSSFExcelToPdfConverterTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NullPointerException
at com.lowagie.text.pdf.PdfPTable.getRowHeight(PdfPTable.java:867)
at com.lowagie.text.pdf.PdfPTable.calculateHeights(PdfPTable.java:419)
at com.lowagie.text.pdf.PdfPTable.setTotalWidth(PdfPTable.java:358)
at com.lowagie.text.pdf.PdfDocument.fitsPage(PdfDocument.java:2529)
at com.lowagie.text.pdf.PdfDocument.addPTable(PdfDocument.java:2483)
at com.lowagie.text.pdf.PdfDocument.add(PdfDocument.java:683)
... 28 more
```