getCount_isNull() tells you whether a count tag was returned at all.  It's not the same as checking getCount()==0.

You really don't need to check the count though sind ForEachItem will exit immediately if count is 0.