Bug 64377 - RangeCopier throw up NPE when copying range containing null rows
Summary: RangeCopier throw up NPE when copying range containing null rows
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 4.1.2-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-25 00:28 UTC by xjlin0
Modified: 2020-05-14 16:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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