]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fix a possible exception when cancelling and rescanning a source that would...
authorsr55 <sr55.hb@outlook.com>
Sun, 16 Apr 2017 09:59:40 +0000 (10:59 +0100)
committersr55 <sr55.hb@outlook.com>
Sat, 29 Apr 2017 18:31:21 +0000 (19:31 +0100)
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs

index c39ad153465b1b4748abe5dabdc76001a139b42a..ceeba965c16af38b262f390e5a73298f596e0151 100644 (file)
@@ -14,7 +14,6 @@ namespace HandBrake.ApplicationServices.Interop
     using System.Diagnostics;\r
     using System.Drawing;\r
     using System.Drawing.Imaging;\r
-    using System.IO;\r
     using System.Linq;\r
     using System.Runtime.ExceptionServices;\r
     using System.Runtime.InteropServices;\r
index 0bcf522166ae800dbd6308973e5d94752b4f0e83..e3163a2bec1d29687a14a6d1c607f169860d2912 100644 (file)
@@ -2299,8 +2299,12 @@ namespace HandBrakeWPF.ViewModels
         /// </param>\r
         private void ScanCompleted(object sender, ScanCompletedEventArgs e)\r
         {\r
-            if (e.ScannedSource != null)\r
+            if (e.ScannedSource != null && !e.Cancelled)\r
             {\r
+                if (this.ScannedSource == null)\r
+                {\r
+                    this.ScannedSource = new Source();\r
+                }\r
                 e.ScannedSource.CopyTo(this.ScannedSource);\r
             }\r
             else\r