Merge branch 'ConfigHandlerNullRef-_79' into Release0.2
This commit is contained in:
commit
111bbd99e4
@ -1,4 +1,5 @@
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
|
||||
namespace ConfigurationHandler
|
||||
{
|
||||
@ -7,7 +8,9 @@ namespace ConfigurationHandler
|
||||
public static string GetConfiguration(string keyName)
|
||||
{
|
||||
var appSettings = ConfigurationManager.OpenExeConfiguration(System.Reflection.Assembly.GetEntryAssembly().Location).AppSettings;
|
||||
return appSettings.Settings[keyName].Value;
|
||||
if(appSettings.Settings.AllKeys.Contains(keyName))
|
||||
return appSettings.Settings[keyName].Value;
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user