get_session_data() check to see if user has session before getting option

Closes #7185
This commit is contained in:
Mike Jolley 2015-01-23 11:13:16 +00:00
parent e8d47748ea
commit 5695f514ed
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class WC_Session_Handler extends WC_Session {
* @return array
*/
public function get_session_data() {
return (array) get_option( '_wc_session_' . $this->_customer_id, array() );
return $this->has_session() ? (array) get_option( '_wc_session_' . $this->_customer_id, array() ) : array();
}
/**