C#: What happens if a foreach is applied to an empty source or if the source is null?

If the source collection of the foreach statement is empty, the body of the foreach statement isn’t executed and skipped.

If the foreach statement is applied to null, a NullReferenceException is thrown.

More Information:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements