adamfisher/Xamarin.Forms.VideoPlayer

Crash on pause during OnDisappearing

Closed this issue · 1 comments

With Xamarin.Forms 2.5 and VideoPlayer 2.1, when I try to call pause in the OnDisappearing event, I get a crash inside the VideoPlayer renderer:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at Octane.Xamarin.Forms.VideoPlayer.iOS.Renderers.VideoPlayerRenderer.CanPause () [0x0000b] in <524edda008f44161a77df819966d70cf>:0
at Octane.Xamarin.Forms.VideoPlayer.iOS.Renderers.VideoPlayerRenderer.Pause () [0x00000] in <524edda008f44161a77df819966d70cf>:0
at Octane.Xamarin.Forms.VideoPlayer.VideoPlayer.<.ctor>b__77_2 () [0x0000a] in :0
at Xamarin.Forms.Command+<>c__DisplayClass5_0.<.ctor>b__0 (System.Object o) [0x00000] in D:\agent_work\1\s\Xamarin.Forms.Core\Command.cs:87
at Xamarin.Forms.Command.Execute (System.Object parameter) [0x00000] in D:\agent_work\1\s\Xamarin.Forms.Core\Command.cs:107
at Octane.Xamarin.Forms.VideoPlayer.VideoPlayer.Pause () [0x00006] in :0
at FDCapture.Pages.TutorialPage.OnDisappearing () [0x00008] in /TFS/FDC1.2/Applications/FDCapture/FDCapture.Shared/Pages/TutorialPage.cs:64
at Xamarin.Forms.Page.SendDisappearing () [0x00040] in D:\agent_work\1\s\Xamarin.Forms.Core\Page.cs:330
at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidDisappear (System.Boolean animated) [0x00025] in :0
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIApplication.cs:63
at FDCapture.iOS.Application.Main (System.String[] args) [0x00001] in /TFS/FDC1.2/Applications/FDCapture/FDCapture.iOS/Main.cs:11

Duplicate of #83. Comments and updates will be provided in that issue.