This is most likely an outdated K2 template override. Switch error reporting in Joomla's Global Configuration to maximum to see the exact file and line that this error occurs in.
In most cases it's just a matter of checking if an array is set before counting its items.
So if you have something like:
if (count($items)) {
// do something, e.g. run a "foreach" loop
}
change it to:
if (isset($items) && count($items)) {
// do something, e.g. run a "foreach" loop
}