diff --git a/MisakaTranslator-WPF/SettingsPages/ArtificialTransSettingsPage.xaml.cs b/MisakaTranslator-WPF/SettingsPages/ArtificialTransSettingsPage.xaml.cs index 81f3c518..4df0d276 100644 --- a/MisakaTranslator-WPF/SettingsPages/ArtificialTransSettingsPage.xaml.cs +++ b/MisakaTranslator-WPF/SettingsPages/ArtificialTransSettingsPage.xaml.cs @@ -30,16 +30,25 @@ public ArtificialTransSettingsPage() ATonCheckBox.IsChecked = Common.appSettings.ATon; PathBox.Text = Common.appSettings.ArtificialPatchPath; - strNames = Directory.GetFiles(Environment.CurrentDirectory + "\\ArtificialTranslation"); + if (Directory.Exists(Environment.CurrentDirectory + "\\ArtificialTranslation")) { + strNames = Directory.GetFiles(Environment.CurrentDirectory + "\\ArtificialTranslation"); - List fileList = new List(); + List fileList = new List(); - for (int i = 0;i < strNames.Length;i++) { - fileList.Add(System.IO.Path.GetFileName(strNames[i])); + for (int i = 0; i < strNames.Length; i++) + { + fileList.Add(System.IO.Path.GetFileName(strNames[i])); + } + + PatchFileCombox.ItemsSource = fileList; + + if (fileList.Count > 0) + { + PatchFileCombox.SelectedIndex = 0; + } } - PatchFileCombox.ItemsSource = fileList; - PatchFileCombox.SelectedIndex = 0; + } private void ChoosePathBtn_Click(object sender, RoutedEventArgs e)