Closed Bug 1946704 Opened 1 month ago Closed 20 days ago

Crash by a NullPointerException of QrFragment with Background Camera

Categories

(Fenix :: QR, defect)

Firefox 137
All
Android
defect

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: 1782769091, Assigned: royang)

References

Details

(Whiteboard: [fxdroid][group3])

Attachments

(1 file)

Steps to reproduce:

User Agent: Mozilla/5.0 (Android 10; Mobile; rv:137.0) Gecko/137.0 Firefox/137.0

I was in MoreOptions - Sync and save data.
Then I entered Ready to scan and went back, next Use email instead.
While I was configuring the email and some page settings, the background camera get a NullPointerException and cause the app crash.

Actual results:

FATAL EXCEPTION: CameraBackground
Process: org.mozilla.fenix.debug, PID: 21788
java.lang.NullPointerException: null cannot be cast to non-null type android.view.Surface
at mozilla.components.feature.qr.QrFragment$createCameraPreviewSession$1.invoke(QrFragment.kt:549)
at mozilla.components.feature.qr.QrFragment$createCameraPreviewSession$1.invoke(QrFragment.kt:546)
at mozilla.components.feature.qr.QrFragment.handleCaptureException(QrFragment.kt:623)
at mozilla.components.feature.qr.QrFragment.createCameraPreviewSession$feature_qr_debug(QrFragment.kt:546)
at mozilla.components.feature.qr.QrFragment$stateCallback$1.onOpened(QrFragment.kt:172)
at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:143)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)

Expected results:

The camera should be already exit porperly?

The severity field is not set for this bug.
:royang, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(royang)

Thanks for reporting this.

Can't reproduce but from the code it looks like this could happen and was not handled correctly. Add check and handle gracefully when surface is null.

Severity: -- → S2
Flags: needinfo?(royang)
Whiteboard: [fxdroid][group3]
Assignee: nobody → royang
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by royang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6a5aca08f726 Handle null QR image reader surface correctly. r=android-reviewers,007
Status: ASSIGNED → RESOLVED
Closed: 20 days ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: