Skip to content

Commit

Permalink
Fix debug code compiling in release
Browse files Browse the repository at this point in the history
  • Loading branch information
jvyden committed Aug 25, 2023
1 parent 4ea8dbe commit b2e9691
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Refresh.GameServer/Types/Levels/Categories/LevelCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ internal LevelCategory(string apiRoute, string gameRoute, bool requiresUser, str
if (method == null) throw new ArgumentNullException(nameof(funcName),
$"{nameof(funcName)} must point to a method on {nameof(GameDatabaseContext)}! Use nameof() to assist with this.");

#if DEBUG
List<string> parameters = method.GetParameters().Select(p => p.Name).ToList()!;
foreach (string expectedParameter in ExpectedParameters)
{
if (parameters.Contains(expectedParameter)) continue;
throw new InvalidOperationException($"Cannot bind to {funcName}() when it is missing a {expectedParameter} parameter");
}
#endif

this._method = method;
}
Expand Down

0 comments on commit b2e9691

Please sign in to comment.