Fix crash on empty body branches in a loop in Next cop

This fixes #1191.