From 6e8ba5a98c43fd99b70ff7844a5469b76ff46d62 Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 22 May 2014 20:15:29 +0000 Subject: WinGui: Handle Zero Pointer better in the NativeList. This can happen sometimes during previews. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6202 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrake.Interop/HandBrakeInterop/Helpers/NativeList.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Helpers/NativeList.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Helpers/NativeList.cs index c77c58cb9..d21f84ed4 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Helpers/NativeList.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Helpers/NativeList.cs @@ -11,6 +11,7 @@ namespace HandBrake.Interop.Helpers { using System; using System.Collections.Generic; + using System.Diagnostics; using System.Runtime.InteropServices; using HandBrake.Interop.HbLib; @@ -45,8 +46,9 @@ namespace HandBrake.Interop.Helpers public int Count { get - { - return HBFunctions.hb_list_count(this.Ptr); + { + Debug.WriteLine("Got a Zero Pointer in the NativeList"); + return this.Ptr == IntPtr.Zero ? 0 : HBFunctions.hb_list_count(this.Ptr); } } -- cgit v1.2.3