Check for existing array before using key. Closes #3807
Merge branch 'master' of https://github.com/woothemes/woocommerce