diff --git a/TorWebClient/TorClient/Configuration/Configuration.cs b/TorWebClient/TorClient/Configuration/Configuration.cs index 823f005..d5408ca 100644 --- a/TorWebClient/TorClient/Configuration/Configuration.cs +++ b/TorWebClient/TorClient/Configuration/Configuration.cs @@ -492,18 +492,28 @@ namespace Tor.Config internal void SetValueDirect(string name, string value) { if (name == null) - throw new ArgumentNullException("name"); - + { + return; +// throw new ArgumentNullException("name"); + } ConfigurationNames association = ReflectionHelper.GetEnumerator(attr => attr.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)); ConfigurationAssocAttribute attribute = ReflectionHelper.GetAttribute(association); if (attribute.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)) { - values[association] = ReflectionHelper.Convert(value, attribute.Type); + try{values[association] = ReflectionHelper.Convert(value, attribute.Type);} + catch(Exception exception) + { + try{values[association] = ReflectionHelper.Convert(value, typeof(String));} + catch(Exception innerException) + { + Console.WriteLine(innerException); + } + } - if (PropertyChanged != null) - PropertyChanged(client, new PropertyChangedEventArgs(attribute.Name)); + if (PropertyChanged != null)PropertyChanged(client, new PropertyChangedEventArgs(attribute.Name)); } + } ///