> For the complete documentation index, see [llms.txt](https://wiki.owain.codes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.owain.codes/coding/c-sharp/null-check-.any.md).

# Null check .any()

You can't just have&#x20;

```
if(content.Any())
{
    // Do something
}
```

The reason is if there is no content then there is nothing to count and do it doesn't exist which means content is equal to null

To combat that you need to null check it.&#x20;

```
 @if (content != null && content.Any())
 {
  // do something
 }
  
```
