fix: foreach in null should execute 0 times
Merge pull request #2005 from davidegrohmann/2.0-fix-foreach-null

fix "foreach in null" should execute 0 times