Protect against missing order in admin assets

Closes #15000
This commit is contained in:
Mike Jolley 2017-05-10 19:26:30 +01:00
parent 75def72ff7
commit 523cf5d4ed
1 changed files with 1 additions and 2 deletions

View File

@ -233,8 +233,7 @@ class WC_Admin_Assets {
$post_id = isset( $post->ID ) ? $post->ID : ''; $post_id = isset( $post->ID ) ? $post->ID : '';
$currency = ''; $currency = '';
if ( $post_id && in_array( get_post_type( $post_id ), wc_get_order_types( 'order-meta-boxes' ) ) ) { if ( $post_id && in_array( get_post_type( $post_id ), wc_get_order_types( 'order-meta-boxes' ) ) && ( $order = wc_get_order( $post_id ) ) ) {
$order = wc_get_order( $post_id );
$currency = $order->get_currency(); $currency = $order->get_currency();
} }