diff --git a/Application/FileConverter/Registry.cs b/Application/FileConverter/Registry.cs index 85d4a64..9ec7958 100644 --- a/Application/FileConverter/Registry.cs +++ b/Application/FileConverter/Registry.cs @@ -80,14 +80,13 @@ namespace FileConverter } } - public static T GetValue(string key) + public static T GetValue(string key, T defaultValue = default(T)) { Registry registry = Registry.Instance; - string stringValue; - if (!registry.registryEntries.TryGetValue(key, out stringValue)) + if (!registry.registryEntries.TryGetValue(key, out string stringValue)) { - return default(T); + return defaultValue; } try @@ -100,7 +99,7 @@ namespace FileConverter Diagnostics.Debug.LogError("Can't convert registry value: {0}.", exception.Message); } - return default(T); + return defaultValue; } public static void SetValue(string key, T value)