]> 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>
Sun, 16 Apr 2017 09:59:40 +0000 (10:59 +0100)
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs

index 861a5edafcce855e47922a8e0c28611266d083ed..7114bab6458d4cdd32b3480388cb0f8a51d6ea36 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 9bb991efc2a86655522515abcd2d3f43e9119aab..0c4637e6f69ef85f3698e7481c750e7f8be46041 100644 (file)
@@ -2336,8 +2336,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