Skip to content

Commit

Permalink
Merge pull request #905 from houlongchao/master
Browse files Browse the repository at this point in the history
add null check in match function
  • Loading branch information
tonyqus authored Aug 15, 2022
2 parents 23a984b + ec1229f commit c848ca6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main/SS/Formula/Functions/Match.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Licensed to the Apache Software Foundation (ASF) Under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for Additional information regarding copyright ownership.
Expand Down Expand Up @@ -243,6 +243,12 @@ private static int FindIndexOfValue(ValueEval lookupValue, ValueVector lookupRan
for (int i = 0; i < size; i++)
{
var item = lookupRange.GetItem(i) as NumericValueEval;
if (item == null)
{
// not a number, skip it
continue;
}

if (lookupComparer.CompareTo(item).IsEqual)
{
return i;
Expand Down

0 comments on commit c848ca6

Please sign in to comment.