Skip to content

Commit 95b2a73

Browse files
committed
Add explicit instanceof check in batch() to prevent fatal error on get_id()
1 parent 7de8c10 commit 95b2a73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/Generator/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public static function batch( $amount, array $args = array() ) {
253253

254254
for ( $i = 1; $i <= $amount; $i ++ ) {
255255
$order = self::generate( true, $args );
256-
if ( ! $order ) {
256+
if ( ! $order instanceof \WC_Order ) {
257257
error_log( "Batch generation failed: Order {$i} of {$amount} could not be generated" );
258258
continue;
259259
}

0 commit comments

Comments
 (0)