From c4a6ecb7f40399ef8daa62caa0bdc473a0668ebb Mon Sep 17 00:00:00 2001 From: Emik Date: Tue, 27 Aug 2024 15:33:46 +0200 Subject: [PATCH] Validate only when necessary --- Quaver.API/Maps/Qua.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Quaver.API/Maps/Qua.cs b/Quaver.API/Maps/Qua.cs index 563b44c5f..6954e66ff 100644 --- a/Quaver.API/Maps/Qua.cs +++ b/Quaver.API/Maps/Qua.cs @@ -1008,9 +1008,7 @@ public static void RestoreDefaultValues(Qua qua) /// private static void AfterLoad(Qua qua, bool checkValidity) { - var errors = qua.Validate(); - - if (checkValidity && errors.Count > 0) + if (checkValidity && qua.Validate() is var errors && errors.Count > 0) throw new ArgumentException(string.Join("\n", errors)); // Try to sort the Qua before returning.