I am using this code
You can add a condition on your dataSource directly without having to access the data or its length:
No data