From c571f5a1defe07e5b71d570d02681cd8d034b258 Mon Sep 17 00:00:00 2001 From: estrogen elf <87099578+BlossomiShymae@users.noreply.github.com> Date: Fri, 13 Jun 2025 23:49:13 -0500 Subject: [PATCH] fix: crash when encountering GetLolVanguardV1Notification --- .../ViewModels/Pages/Endpoints/OperationViewModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Needlework.Net/ViewModels/Pages/Endpoints/OperationViewModel.cs b/Needlework.Net/ViewModels/Pages/Endpoints/OperationViewModel.cs index 09109c6..71381bf 100644 --- a/Needlework.Net/ViewModels/Pages/Endpoints/OperationViewModel.cs +++ b/Needlework.Net/ViewModels/Pages/Endpoints/OperationViewModel.cs @@ -253,8 +253,9 @@ public partial class OperationViewModel : ObservableObject return "none"; } - public static string GetSchemaType(OpenApiSchema schema) + public static string GetSchemaType(OpenApiSchema? schema) { + if (schema == null) return "object"; // Because GetLolVanguardV1Notification exists where it has a required parameter without a type... if (schema.Reference != null) return schema.Reference.Id; if (schema.Type == "object" && schema.AdditionalProperties?.Reference != null) return schema.AdditionalProperties.Reference.Id; if (schema.Type == "integer" || schema.Type == "number") return $"{schema.Type}:{schema.Format}";