From 27c6623510a6b1b64e0a229140c2323fe8dc52e5 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 19 Dec 2009 21:15:38 +0000 Subject: WinGui: - Fix a crash when a preset with crop values is selected before the first source is scanned. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3037 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Controls/PictureSettings.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'win/C#/Controls') diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs index bbca24dc1..d46efb8f2 100644 --- a/win/C#/Controls/PictureSettings.cs +++ b/win/C#/Controls/PictureSettings.cs @@ -380,10 +380,13 @@ namespace Handbrake.Controls crop_left.Enabled = check_customCrop.Checked; crop_right.Enabled = check_customCrop.Checked; - crop_top.Value = Source.AutoCropDimensions[0]; - crop_bottom.Value = Source.AutoCropDimensions[1]; - crop_left.Value = Source.AutoCropDimensions[2]; - crop_right.Value = Source.AutoCropDimensions[3]; + if (Source != null) + { + crop_top.Value = Source.AutoCropDimensions[0]; + crop_bottom.Value = Source.AutoCropDimensions[1]; + crop_left.Value = Source.AutoCropDimensions[2]; + crop_right.Value = Source.AutoCropDimensions[3]; + } } private void crop_ValueChanged(object sender, EventArgs e) { @@ -507,5 +510,6 @@ namespace Handbrake.Controls if (PictureSettingsChanged != null) PictureSettingsChanged(this, new EventArgs()); } + } } \ No newline at end of file -- cgit v1.2.3