Fix: When invalidating data source, check the cells exist first

- Fixes the issue highlighted in thread 19822