Bug 57642 - Worksheet setSheetName() fails when IFERROR function is present
Summary: Worksheet setSheetName() fails when IFERROR function is present
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.11-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-27 14:30 UTC by Alessandro Guarascio
Modified: 2015-04-24 02:13 UTC (History)
0 users



Attachments
A proposed patch (not sure it's the right solution!) (756 bytes, text/plain)
2015-02-27 14:30 UTC, Alessandro Guarascio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Guarascio 2015-02-27 14:30:15 UTC
Created attachment 32524 [details]
A proposed patch (not sure it's the right solution!)

When an IFERROR() function is present into a cell, renaming worksheet via sheet.setSheetName() leads to a NullPointerException

Here is the stacktrace
java.lang.NullPointerException
	at org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils.updatePtg(XSSFFormulaUtils.java:128)
	at org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils.updateFormula(XSSFFormulaUtils.java:98)
	at org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils.updateSheetName(XSSFFormulaUtils.java:78)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.setSheetName(XSSFWorkbook.java:1368)

That worked on POI 3.10 release.
Comment 1 Nick Burch 2015-04-24 02:13:45 UTC
This should hopefully be fixed in r1675745, along with a related bug with range sheet references