Fix issue #580

This change adds the null check in function ensureCellNodesInRowsCache.