Author: gwoolsey
Date: Thu Dec 28 08:17:33 2017
New Revision: 1819398

URL: http://svn.apache.org/viewvc?rev=1819398&view=rev
Log:
Added a couple missing null checks.

Modified:
    poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java
    poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java

Modified: 
poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java?rev=1819398&r1=1819397&r2=1819398&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java 
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java 
Thu Dec 28 08:17:33 2017
@@ -120,7 +120,7 @@ final class OperationEvaluatorFactory {
                        EvaluationSheet evalSheet = 
ec.getWorkbook().getSheet(ec.getSheetIndex());
                    EvaluationCell evalCell = 
evalSheet.getCell(ec.getRowIndex(), ec.getColumnIndex());
 
-                   if ((evalCell.isPartOfArrayFormulaGroup() || 
ec.isInArrayContext()) && result instanceof ArrayFunction)
+                   if (evalCell != null && 
(evalCell.isPartOfArrayFormulaGroup() || ec.isInArrayContext()) && result 
instanceof ArrayFunction)
                        return ((ArrayFunction) result).evaluateArray(args, 
ec.getRowIndex(), ec.getColumnIndex());
                                
                        return  result.evaluate(args, ec.getRowIndex(), (short) 
ec.getColumnIndex());

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java?rev=1819398&r1=1819397&r2=1819398&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java 
(original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java Thu Dec 
28 08:17:33 2017
@@ -597,7 +597,7 @@ public final class WorkbookEvaluator {
         EvaluationSheet evalSheet = 
ec.getWorkbook().getSheet(ec.getSheetIndex());
         EvaluationCell evalCell = evalSheet.getCell(ec.getRowIndex(), 
ec.getColumnIndex());
  
-        if (evalCell.isPartOfArrayFormulaGroup() && evaluationResult 
instanceof AreaEval) {
+        if (evalCell != null && evalCell.isPartOfArrayFormulaGroup() && 
evaluationResult instanceof AreaEval) {
             value = OperandResolver.getElementFromArray((AreaEval) 
evaluationResult, evalCell);
         }
         else {



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

Reply via email to