This repository has been archived by the owner on May 1, 2024. It is now read-only.
[Bug] CameraFragment.DisposeImageReader Null Reference Exception #1958
Labels
bug
Something isn't working. Breaky break.
Description
Upon calling the Navigation.PopModalAsync on a page that contains the CameraView a Null Reference Exception is raised from the CameraFragment.DisposeImageReader method.
Stack Trace
Xamarin Exception Stack:
System.NullReferenceException: Object reference not set to an instance of an object
at Xamarin.CommunityToolkit.UI.Views.CameraFragment.DisposeImageReader () [0x00013] in <0a68dce273b64a29949c8b1d7ab84eee>:0
at Xamarin.CommunityToolkit.UI.Views.CameraFragment.CloseDevice () [0x00051] in <0a68dce273b64a29949c8b1d7ab84eee>:0
at Xamarin.CommunityToolkit.UI.Views.CameraFragment.CloseDevice (Android.Hardware.Camera2.CameraDevice inputDevice) [0x00009] in <0a68dce273b64a29949c8b1d7ab84eee>:0
at Xamarin.CommunityToolkit.UI.Views.CameraFragment.b__63_3 (Android.Hardware.Camera2.CameraDevice device) [0x00013] in <0a68dce273b64a29949c8b1d7ab84eee>:0
at Xamarin.CommunityToolkit.UI.Views.CameraStateListener.OnClosed (Android.Hardware.Camera2.CameraDevice camera) [0x0000a] in <0a68dce273b64a29949c8b1d7ab84eee>:0
at Android.Hardware.Camera2.CameraDevice+StateCallback.n_OnClosed_Landroid_hardware_camera2_CameraDevice_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_camera) [0x0000f] in :0
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V (_JniMarshal_PPL_V callback, System.IntPtr jnienv, System.IntPtr klazz, System.IntPtr p0) [0x00005] in :0
Secondary Stack Trace
Xamarin.CommunityToolkit.UI.Views
CameraFragment.DisposeImageReader ()
Xamarin.CommunityToolkit.UI.Views
CameraFragment.CloseDevice ()
Xamarin.CommunityToolkit.UI.Views.CameraFragment.Android.Views.TextureView
ISurfaceTextureListener.OnSurfaceTextureDestroyed (Android.Graphics.SurfaceTexture surface)
Android.Views
TextureView+ISurfaceTextureListenerInvoker.n_OnSurfaceTextureDestroyed_Landroid_graphics_SurfaceTexture_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_surface)
Android.Runtime
JNINativeWrapper.Wrap_JniMarshal_PPL_Z (_JniMarshal_PPL_Z callback, System.IntPtr jnienv, System.IntPtr klazz, System.IntPtr p0)
Java.Interop
JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args)
Java.Interop
JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
Android.Views
ViewGroup.RemoveView (Android.Views.View view)
Xamarin.Forms.Platform.Android
ViewExtensions.RemoveFromParent (Android.Views.View view)
Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms
INavigation.PopModalAsync (System.Boolean animated)
Xamarin.Forms.Internals
NavigationProxy.OnPopModal (System.Boolean animated)
Xamarin.Forms
Application+NavigationImpl.<>n__0 (System.Boolean animated)
Xamarin.Forms
Application+NavigationImpl.OnPopModal (System.Boolean animated)
MyView
PhotoCaptureView.OKButton_OnClicked (System.Object sender, System.EventArgs e)
Steps to Reproduce
Expected Behavior
No exception is raised
Actual Behavior
A Null Reference Exception is raised sometimes. This doesn't happen all the time.
Basic Information
Workaround
No workaround found at this time.
The text was updated successfully, but these errors were encountered: