From b2e9691a61ffda277b3be374bbba655a2d8d008c Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 24 Aug 2023 23:54:01 -0400 Subject: [PATCH] Fix debug code compiling in release --- Refresh.GameServer/Types/Levels/Categories/LevelCategory.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Refresh.GameServer/Types/Levels/Categories/LevelCategory.cs b/Refresh.GameServer/Types/Levels/Categories/LevelCategory.cs index 36fca495..54ee9f27 100644 --- a/Refresh.GameServer/Types/Levels/Categories/LevelCategory.cs +++ b/Refresh.GameServer/Types/Levels/Categories/LevelCategory.cs @@ -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 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; }