From bf57c1610e405a9a6171a897983fb87b4a1937d0 Mon Sep 17 00:00:00 2001 From: Sean Kessler Date: Wed, 6 Mar 2024 23:58:02 -0500 Subject: [PATCH] Fix. --- .../TorClient/Configuration/Configuration.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) 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)); } + } ///