This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by code review....
Under what circumstances is it null? It looks like it gets set in
open()
and null'd out inclose()
. Is the error you're seeing that the surface is null, and if so, how/when does the surface get populated?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this error: "android.view.Surface android.media.ImageReader.getSurface() on a null object reference" if the surface is not visible immediately after accepting the camera permissions, and the app crashes. If I reopen the app, I no longer see the error. I think that an extra check for null safety is not bad if it saves from crashes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gioxxy could you possibly update your pubspec for your app to point to a locally modified camera plugin with heavy instrumentation (Android logs) added, so you can look at the logs and see what order stuff is happening in?
I'd like to understand how it comes to be that
pictureImageReader
orpictureImageReader.getSurface()
gets nulled out - maybe there's a better solution than a simple null check here.