This commit is contained in:
ChsBuffer
2021-03-31 19:53:59 +08:00
parent 42b609b597
commit 483dccc5d2
2 changed files with 2 additions and 3 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Linq;
using System.Reflection;
using Netch.Utils;
namespace Netch.Models
{
@@ -49,7 +48,7 @@ namespace Netch.Models
case bool b:
return b ? $"{prefix}{key}" : null;
default:
if ((value?.ToString() ?? null).IsNullOrWhiteSpace())
if (string.IsNullOrWhiteSpace(value?.ToString()))
return p.IsDefined(typeof(OptionalAttribute)) ? null : throw new RequiredArgumentValueInvalidException(p.Name, this, null);
if (p.IsDefined(typeof(QuoteAttribute)))