org.apache.poi.hssf.model.Sheet: org.apache.poi.hssf.usermodel.HSSFSheet: Description: If the actual sheet has no merged cells, the member "merged" was null and the method getNumMergedRegions() throws an exception (NullPointerException). I'm converting with this method excel files to html-tables and I'm using the regions to handle colspans and rowspans for the html-table output. Idea for a solution: * Add a method "hasSheetSomeRegions()" to the class Sheet.java and HSSFSheet.java for checking the member "merged" is null or * extends the method "geNumMergedRegions()" like this: public int getNumMergedRegions() { return merged!=null ? merged.getNumAreas() : 0; } Regards Jens
supply this as a CVS diff -u patch per the instructions on the "get involved" page and I'll apply it. Also getMergedRegions shoud just return 0 if merged is null. This is a bug.
Created attachment 3423 [details] Patch for sheet.java
Applied. Thanks! Please cross check. Next time remember to add yourself to the @author tags.
*** Bug 14919 has been marked as a duplicate of this bug. ***
public int getNumMergedRegions() { return merged.getNumAreas(); } but "merged" now is null.