react-native-documents / document-picker

Document Picker for React Native

Home Page:https://react-native-documents.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] please fix crash for android when onActivityResult called from other module but documentScanner = null

fukemy opened this issue · comments

Hi, I am using other lib(photo editor), it's using onActivityResult to get the image, but the module onActivityResult triggered + documentScanner = null => app crashed

Please fix like this to avoid crash

private ActivityEventListener activityEventListener = new BaseActivityEventListener() {
        @Override
        public void onActivityResult(
                final Activity activity,
                final int requestCode,
                final int resultCode,
                final Intent intent) {
            // trigger callbacks (success, cancel, error)
            if (requestCode == DOCUMENT_SCAN_REQUEST) {
                if(documentScanner != null){
                    documentScanner.handleDocumentScanIntentResult(
                            new ActivityResult(resultCode, intent)
                    );
                }
            }
        }
    };

👋 @fukemy, sorry you're having an issue. This issue is being closed because it does not provide all information required by the issue template. As the issue template explains, we require that you provide a runnable example that reproduces your issue and your environment information. This means you need to provide a code snippet that we can copy-paste into an empty project and see the error ourselves, or provide a git repository with the issue.
The reason is that maintainers do not have time to try reproduce bugs themselves. Please try to minimize the superfluous code and focus only on reproducing the bug.
Please create a new issue with this and we'll be happy to review it!

Hello and thanks for reporting,
there is no documentScanner used in this library. Feel free to reopen (please follow the issue template).
Thank you 🙂