What if cell is a wall (#)? You can't stand on a wall, so no paths can reach it. Set for any wall cell. Walls block paths completely.
Any path that would have gone through a wall simply doesn't exist. Work through examples by hand before coding. Understanding the pattern makes implementation simple. Practice with similar problems to reinforce your understanding. Walls block paths. If a cell is blocked, set its DP value to 0 so no paths go through it.