csbiy opened a new pull request, #789:
URL: https://github.com/apache/fesod/pull/789

   ## Purpose of the pull request
   
   Fixes #788
   
   The `afterWorkbookDispose` method throws `NullPointerException` when 
`hasBeenInitializedSheetIndexMap` contains null values.
   
   ## What's changed?
   
   Added a guard clause to skip null entries in the map before accessing 
`getSheet()`.
   
   **Before:**
   ```java
   for (WriteSheetHolder writeSheetHolder : writeSheetHolderMap.values()) {
       if (writeSheetHolder.getSheet() == null  // NPE here when 
writeSheetHolder is null
               || !(writeSheetHolder.getSheet() instanceof SXSSFSheet)) {
           continue;
       }
   ```
   
   **After:**
   ```java
   for (WriteSheetHolder writeSheetHolder : writeSheetHolderMap.values()) {
       // map can contain null entries
       if (writeSheetHolder == null) {
           continue;
       }
       if (writeSheetHolder.getSheet() == null
               || !(writeSheetHolder.getSheet() instanceof SXSSFSheet)) {
           continue;
       }
   ```
   
   ## Checklist
   
   - [x] I have read the Contributor Guide 
(https://fesod.apache.org/community/contribution/).
   - [x] I have written the necessary doc or comment.
   - [x] I have added the necessary unit tests and all cases have passed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to