Test code below leads to a NPE during runtime due to the way the Java compiler handles unboxing during compilation/linking. import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class Main { public static void main(String[] args) throws Exception { Integer nullint = null; XSSFWorkbook workbook = new XSSFWorkbook(); XSSFSheet sheet = workbook.createSheet("Sheet"); XSSFRow row = sheet.createRow(0); XSSFCell nullCell = row.createCell(0); nullCell.setCellValue(nullint); } } Since the XSSFCell does not provide a method which accepts boxed values, or an Object, the Java compiler decides the "setCellValue(double value)" method is the best method to link to. At runtime the JVM tries to unbox the null Integer, or any other numeric value, and throws an NPE. Currently, a workaround can be done by first manually checking whether the value being written is null before the call to setCellValue, but this should not be needed.
Sorry, but this is how the API is intended, not a problem that we want to fix in Apache POI itself. Please adjust your code so you do cause a NullPointerException in your code. We want to ensure that we get a valid integer value in the setCellValue() anyway, a null would be invalid and the only way to handle it would be to throw an exception, so you need to handle this before calling the interface here.