Check for empty cards array before looping over them.
Merge remote-tracking branch 'origin/7.x-4.x_no_array_check_on_stored_cards' into 7.x-4.0-beta3.x