summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs12
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs2
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs11
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs7
5 files changed, 32 insertions, 3 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
index 203459e9c..f7d07efb2 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
@@ -261,7 +261,17 @@ namespace HandBrake.ApplicationServices.Services
}
EncodeJob encodeJob = InteropModelCreator.GetEncodeJob(job);
- BitmapImage bitmapImage = this.instance.GetPreview(encodeJob, preview);
+
+ BitmapImage bitmapImage = null;
+ try
+ {
+ bitmapImage = this.instance.GetPreview(encodeJob, preview);
+ }
+ catch (AccessViolationException e)
+ {
+ Console.WriteLine(e);
+ }
+
return bitmapImage;
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
index 43c11a9bf..fd08f6408 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
@@ -220,7 +220,7 @@ namespace HandBrake.ApplicationServices.Services
/// </returns>
public bool CheckForDestinationPathDuplicates(string destination)
{
- return this.queue.Any(job => job.Task != null && job.Task.Destination.Contains(destination.Replace("\\\\", "\\")));
+ return this.queue.Any(job => job.Task != null && job.Task.Destination != null && job.Task.Destination.Contains(destination.Replace("\\\\", "\\")));
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 3431412ba..45a63951a 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.18408
+// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -636,6 +636,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to You must first set the destination path for the output file before adding to the queue..
+ /// </summary>
+ public static string Main_SetDestination {
+ get {
+ return ResourceManager.GetString("Main_SetDestination", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to You must turn on automatic file naming AND set a default path in preferences before you can add to the queue..
/// </summary>
public static string Main_TurnOnAutoFileNaming {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index ee4f864f9..d86c6cc5b 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -501,4 +501,7 @@ Do you wish to proceed?</value>
<data name="Preset_UnableToImport_Message" xml:space="preserve">
<value>Unable to import the preset as it appears to be corrupted or from an older version of HandBrake.</value>
</data>
+ <data name="Main_SetDestination" xml:space="preserve">
+ <value>You must first set the destination path for the output file before adding to the queue.</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index d5d02a0f8..aa60adf68 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1135,7 +1135,14 @@ namespace HandBrakeWPF.ViewModels
return;
}
+ if (string.IsNullOrEmpty(this.CurrentTask.Destination))
+ {
+ this.errorService.ShowMessageBox(Resources.Main_SetDestination, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+
QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create());
+
+
if (!this.queueProcessor.CheckForDestinationPathDuplicates(task.Task.Destination))
{
this.queueProcessor.Add(task);