Skip to content

Commit

Permalink
Validate only when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Emik03 committed Aug 27, 2024
1 parent cc89c86 commit c4a6ecb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Quaver.API/Maps/Qua.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,9 +1008,7 @@ public static void RestoreDefaultValues(Qua qua)
/// <exception cref="ArgumentException"></exception>
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.
Expand Down

0 comments on commit c4a6ecb

Please sign in to comment.