[fix] test array before foreach

This fixes a notice in banner client form:

![banner_client_bug](https://f.cloud.github.com/assets/1119272/1265234/f569ddfa-2c6b-11e3-8779-d18a98cf315a.png)