[Bug 59322] New: Unable to process table if a table cell has a null descriptor

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 59322] New: Unable to process table if a table cell has a null descriptor

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=59322

            Bug ID: 59322
           Summary: Unable to process table if a table cell has a null
                    descriptor
           Product: POI
           Version: 3.13-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HWPF
          Assignee: [hidden email]
          Reporter: [hidden email]

Created attachment 33760
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33760&action=edit
The sample file to reproduce the issue

If you try to process the table with a table cell having the null descriptor,
we get the Null pointer exception. The sample file to reproduce the issue is
also attached.

CODE :

import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.HWPFDocumentCore;
import org.apache.poi.hwpf.converter.WordToHtmlConverter;
import org.w3c.dom.Document;

import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
import java.io.FileInputStream;

public class PoiIssues {

    public static void main(String[] args) throws Exception {
        File file = new File("word-doc-with-revised-table.doc");
        FileInputStream fileInputStream = new FileInputStream(file);
        Document document =
DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        WordToHtmlConverter wordToHtmlConverter = new
WordToHtmlConverter(document);
        HWPFDocumentCore hwpfDocumentCore = new
HWPFDocument(HWPFDocumentCore.verifyAndBuildPOIFS(fileInputStream));
        wordToHtmlConverter.processDocument(hwpfDocumentCore);
        System.out.println(document.toString());
        System.out.println("Process Complete");
    }
}


EXCEPTION :

Exception in thread "main" java.lang.NullPointerException
    at
org.apache.poi.hwpf.usermodel.TableCell.isVerticallyMerged(TableCell.java:66)
    at
org.apache.poi.hwpf.converter.WordToHtmlConverter.processTable(WordToHtmlConverter.java:643)
    at
org.apache.poi.hwpf.converter.AbstractWordConverter.processParagraphes(AbstractWordConverter.java:1073)
    at
org.apache.poi.hwpf.converter.WordToHtmlConverter.processSingleSection(WordToHtmlConverter.java:608)
    at
org.apache.poi.hwpf.converter.AbstractWordConverter.processDocument(AbstractWordConverter.java:721)
    at PoiIssues.main(PoiIssues.java:20)

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 59322] Unable to process table if a table cell has a null descriptor

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=59322

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 59322] Unable to process table if a table cell has a null descriptor

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=59322

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Dominik Stadler <[hidden email]> ---
This should be fixed now on trunk via r1866185. Test-case was adjusted some
more with r1866186.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]