More preventive check for order object in tracks.

This commit is contained in:
vedanshujain 2020-04-08 11:43:20 +00:00
parent e573390356
commit fcd4057218
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ class WC_Order_Tracking {
* @param WC_Order $order Order.
*/
public function track_order_viewed( $order ) {
if ( ! $order->get_id() ) {
if ( ! $order instanceof WC_Order || ! $order->get_id() ) {
return;
}
$properties = array(