Skip to content

Commit

Permalink
Correct inverted default Ctor check
Browse files Browse the repository at this point in the history
  • Loading branch information
Spartan322 committed Nov 5, 2021
1 parent 36c524d commit d35e48f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PathfinderAPI/Util/ErrorHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void ThrowNotInherit<InheritT>(this Type type, string typeRefName,

public static void ThrowNoDefaultCtor(this Type type, string nameOf)
{
if(!type.GetConstructors().Any(m => m.GetParameters().Length != 0))
if(type.GetConstructors().All(m => m.GetParameters().Length != 0))
throw new ArgumentException($"{nameOf} must have a default constructor", nameOf);
}

Expand Down Expand Up @@ -45,4 +45,4 @@ public static void ThrowNotSameSizeAs(this ICollection left, string leftNameOf,
throw new ArgumentException($"{leftNameOf} is not same size as {rightNameOf}");
}
}
}
}

0 comments on commit d35e48f

Please # to comment.