Skip to content

Commit 5365993

Browse files
authored
Merge pull request OfficeDev#32 from leocui9387/patch-1
Line 419: Null Reference Exception on empty cells
2 parents 132ca44 + 20281fd commit 5365993

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/how-to-retrieve-the-values-of-cells-in-a-spreadsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ code sample in C\# and Visual Basic.
416416
Where(c => c.CellReference == addressName).FirstOrDefault();
417417

418418
// If the cell does not exist, return an empty string.
419-
if (theCell != null)
419+
if (theCell.InnerText.Length > 0)
420420
{
421421
value = theCell.InnerText;
422422

0 commit comments

Comments
 (0)