diff --git a/woo-razorpay.php b/woo-razorpay.php index 7e108285..f2887354 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -1086,7 +1086,9 @@ function check_razorpay_response() $postData = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_status FROM $wpdb->posts AS P WHERE post_type=%s AND post_password = %s", $post_type, $post_password ) ); - if (count($postData[0]) > 0) + $arrayPost = json_decode(json_encode($postData), true); + + if (!empty($arrayPost) && count($arrayPost[0]) > 0) { $orderId = $postData[0]->ID;