fix 3.7 metadata crash

This commit is contained in:
Lightczx
2023-05-23 13:13:41 +08:00
parent b607bbf819
commit c7e3b18d62
4 changed files with 6 additions and 4 deletions

View File

@@ -20,8 +20,6 @@ internal sealed class ExceptionFormat
/// <returns>格式化后的异常</returns>
public static string Format(Exception exception)
{
// TODO: handle WinRT.ExceptionHelpers+__RestrictedErrorObject
StringBuilder builder = new();
builder.AppendLine("Exception Data:");
@@ -29,7 +27,9 @@ internal sealed class ExceptionFormat
{
builder
.Append(entry.Key)
.Append(':')
.Append(":[")
.Append(TypeNameHelper.GetTypeDisplayName(entry.Value))
.Append("]:")
.Append(entry.Value)
.Append(StringLiterals.CRLF);
}

View File

@@ -57,7 +57,7 @@ internal static class TypeNameHelper
public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter)
{
StringBuilder? builder = null;
string? name = ProcessType(ref builder, type, new DisplayNameOptions(fullName, includeGenericParameterNames, includeGenericParameters, nestedTypeDelimiter));
string? name = ProcessType(ref builder, type, new(fullName, includeGenericParameterNames, includeGenericParameters, nestedTypeDelimiter));
return name ?? builder?.ToString() ?? string.Empty;
}

View File

@@ -35,6 +35,7 @@ internal enum GrowCurveType
GROW_CURVE_HP_S4 = 22,
GROW_CURVE_HP_2 = 23,
GROW_CURVE_ATTACK_2 = 24,
GROW_CURVE_HP_ENVIRONMENT = 25,
GROW_CURVE_ATTACK_S5 = 31,
GROW_CURVE_ATTACK_S4 = 32,
GROW_CURVE_ATTACK_S3 = 33,

View File

@@ -38,6 +38,7 @@ internal sealed class AvatarNameCardPicConverter : ValueConverter<Avatar.Avatar?
return avatarName switch
{
"Yae" => "Yae1",
"Momoka" => "Kirara",
_ => avatarName,
};
}