mirror of https://github.com/apache/poi.git
Added a couple missing null checks.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819398 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
94bec76385
commit
6e67de2160
|
@ -120,7 +120,7 @@ final class OperationEvaluatorFactory {
|
||||||
EvaluationSheet evalSheet = ec.getWorkbook().getSheet(ec.getSheetIndex());
|
EvaluationSheet evalSheet = ec.getWorkbook().getSheet(ec.getSheetIndex());
|
||||||
EvaluationCell evalCell = evalSheet.getCell(ec.getRowIndex(), ec.getColumnIndex());
|
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 ((ArrayFunction) result).evaluateArray(args, ec.getRowIndex(), ec.getColumnIndex());
|
||||||
|
|
||||||
return result.evaluate(args, ec.getRowIndex(), (short) ec.getColumnIndex());
|
return result.evaluate(args, ec.getRowIndex(), (short) ec.getColumnIndex());
|
||||||
|
|
|
@ -597,7 +597,7 @@ public final class WorkbookEvaluator {
|
||||||
EvaluationSheet evalSheet = ec.getWorkbook().getSheet(ec.getSheetIndex());
|
EvaluationSheet evalSheet = ec.getWorkbook().getSheet(ec.getSheetIndex());
|
||||||
EvaluationCell evalCell = evalSheet.getCell(ec.getRowIndex(), ec.getColumnIndex());
|
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);
|
value = OperandResolver.getElementFromArray((AreaEval) evaluationResult, evalCell);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue