Bug 64377

Summary: RangeCopier throw up NPE when copying range containing null rows
Product: POI Reporter: xjlin0
Component: POI OverallAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 4.1.2-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   

Description xjlin0 2020-04-25 00:28:52 UTC
On POI org.apache.poi:poi-ooxml:4.1.2. When using RangeCopier to copy a range with null rows, RangeCopier throw up NPE as such:

Range example:

row# +--------------
0    |data data data
-----+--------------
1    | null
-----+--------------
2    |data data data

2020-04-24 17:10:33.224 [,myservice,,] ERROR https-jsse-nio-9420-exec-8 [dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException: null
        at org.apache.poi.ss.usermodel.RangeCopier.copyRange(RangeCopier.java:89)
        at org.apache.poi.ss.usermodel.RangeCopier.copyRange(RangeCopier.java:68)

Here is my initial idea of patch, any suggestions are welcomed. Thanks!
https://github.com/apache/poi/pull/177
Comment 1 Dominik Stadler 2020-05-14 16:18:42 UTC
Resolved via r1877010