diff --git a/includes/class-wcpdf-admin.php b/includes/class-wcpdf-admin.php index 3ed5d79f6..9a14ef45e 100644 --- a/includes/class-wcpdf-admin.php +++ b/includes/class-wcpdf-admin.php @@ -1348,7 +1348,9 @@ public function ajax_fetch_pdf_document_data(): void { wp_send_json_success( $documents_data ); } - wp_die(); + wp_send_json_error( array( + 'message' => esc_html__( 'Documents data is empty!', 'woocommerce-pdf-invoices-packing-slips' ), + ) ); } }