wkk91193 commented on a change in pull request #457: Fixing Apache POI issue - 
Formula Cell evaluation nullpointer exception
URL: https://github.com/apache/fineract/pull/457#discussion_r244279239
 
 

 ##########
 File path: 
fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java
 ##########
 @@ -63,8 +63,13 @@ public static Long readAsLong(int colIndex, Row row) {
         FormulaEvaluator eval = 
row.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
         if(c.getCellType() == Cell.CELL_TYPE_FORMULA) {
             if(eval!=null) {
-                CellValue val = eval.evaluate(c);
-                return ((Double) val.getNumberValue()).longValue();
+                CellValue val = null;
 
 Review comment:
   @ShruthiRajaram When any excel formula is evaluated to null, a null pointer 
is thrown fromApache POI API, this is what's being handled.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to