I want to give the user a mean to upload and display a PDF component, and change the file if it turns out to be the wrong one. This works the first time the user upload a file, but the second time the app crashes with the error message : “Cannot read properties of null (reading ‘sendWithPromise’)”
I have the following settings :
I was able to recreate the issue on my machine and have registered a challenge for it.
This issue occurs when the PDF component is initially loaded with one file, and then the source of the PDF is changed an additional time. As a workaround, try to load the PDF component only when you know the content of the PDF is available. Manipulating the visibility of the PDF reader with an app variable and resetting it before reading the content.
We’ll keep you updated if we find a better solution for the problem.
Just a follow-up. The app also crashes with the same message if I try to persist the PDF file (t) object while the PFD is still visible on the screen. Hiding the PDF viewer (or in my case closing the dialog) before persisting avoids the crash.