Encountering a Null Object Exception during React Native Image-to-PDF Conversion

Using the react-native-pic2pdf library, converting images to PDF produces a ‘null object’ error. Both remote URLs and local paths trigger this issue.

const pics = ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'];

async function assemblePDF() {
  try {
    const config = { files: pics, outputName: 'Document' };
    const pdfResult = await RNPic2Pdf.generatePDF(config);
    console.log(pdfResult.location);
  } catch (exception) {
    console.error(exception);
  }
}

hey, i had similar issues with this lib. try to check if the urls are properly formatted. maybe pre-download the images to local storage might make a difference. theres a chance the null object error is due to async fetching issues