Fix L:724 -> Invalid argument supplied for foreach()