Check if customer creation date is not null before formatting (https://github.com/woocommerce/woocommerce-admin/pull/1926)

This commit is contained in:
Joshua T Flowers 2019-03-27 11:46:47 +08:00 committed by GitHub
parent 067ae2170b
commit 896a790d8f
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store
$customer = new WC_Customer( $user_id );
$data['user_id'] = $user_id;
$data['username'] = $customer->get_username( 'edit' );
$data['date_registered'] = $customer->get_date_created( 'edit' )->date( WC_Admin_Reports_Interval::$sql_datetime_format );
$data['date_registered'] = $customer->get_date_created( 'edit' ) ? $customer->get_date_created( 'edit' )->date( WC_Admin_Reports_Interval::$sql_datetime_format ) : null;
$format[] = '%d';
$format[] = '%s';
$format[] = '%s';