Invalid argument supplied for foreach() in BasicFormatter.php

bug: 52897
Change-Id: I28f447af75f699d4bd7d4d045f030e70cea437d6