This commit is contained in:
JustArchi
2020-11-28 22:06:54 +01:00
parent be808be3db
commit 8fb91fe58b

View File

@@ -20,6 +20,7 @@
// limitations under the License. // limitations under the License.
using System; using System;
using System.ComponentModel;
using System.Globalization; using System.Globalization;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -49,7 +50,7 @@ namespace ArchiSteamFarm.Helpers {
[PublicAPI] [PublicAPI]
public async Task<(bool Success, T? Result)> GetValue(EFallback fallback = EFallback.DefaultForType) { public async Task<(bool Success, T? Result)> GetValue(EFallback fallback = EFallback.DefaultForType) {
if (!Enum.IsDefined(typeof(EFallback), fallback)) { if (!Enum.IsDefined(typeof(EFallback), fallback)) {
throw new ArgumentNullException(nameof(fallback)); throw new InvalidEnumArgumentException(nameof(fallback), (int) fallback, typeof(EFallback));
} }
if (IsInitialized && IsRecent) { if (IsInitialized && IsRecent) {