Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

pdf viewer error handle in diffrent format values (#1288)

vishnuszipstackedaa69bea8d5
diff --git a/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx b/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx
index 6ab39368a..a728657fd 100644
--- a/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx
+++ b/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx
@@ -21,9 +21,11 @@ function PdfViewer({ fileUrl, highlightData }) {
const { jumpToPage } = pageNavigationPluginInstance;
const parentRef = useRef(null);
function removeZerosAndDeleteIfAllZero(highlightData) {
- return highlightData?.filter((innerArray) =>
- innerArray.some((value) => value !== 0)
- );
+ return highlightData?.filter((innerArray) => {
+ return (
+ Array.isArray(innerArray) && innerArray.some((value) => value !== 0)
+ );
+ });
}
const processHighlightData = highlightData