Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GenericMultipleBarcodeReader.as #16

Closed
wants to merge 1 commit into from
Closed

Update GenericMultipleBarcodeReader.as #16

wants to merge 1 commit into from

Conversation

garybenade
Copy link

Added check for result of delegate.decode and returning if null.
This was causing the check (existingResult.getText() == result.getText() to fail resulting in an incorrect null return from the decodeMultiple function

Added check for result of delegate.decode and returning if null.
This was causing the check (existingResult.getText() == result.getText() to fail resulting in an incorrect null return from the decodeMultiple function
@srowen
Copy link
Contributor

srowen commented Sep 3, 2013

OK, I can commit that, but this is just a mirror of the SVN repo so pull requests aren't directly usable. A patch and issue at code.google.com/p/zxing is the usual mechanism

@srowen srowen closed this Sep 3, 2013
@srowen
Copy link
Contributor

srowen commented Sep 3, 2013

Hmm wait a sec, what returns null? decode() shouldn't return null, and if something does, that's really the bug

@garybenade
Copy link
Author

The delegate can throw an exception which will be caught and the function will return at that point allowing the next barcode to be decoded. The proper way to fix this would be to throw an exception in the delegate which will trigger the return in the catch but this effectively serves the same purpose. This code change is tested and fixes the problem.

@srowen
Copy link
Contributor

srowen commented Sep 3, 2013

Yes, that's how the whole code works, via the exceptions. If something is returning null instead, that should be fixed. I don't know this code and it's not supported, so you may want to fork and do what you want with it if you're not in a position to patch the broader issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants