diff --git a/src/HotChocolate/Core/src/Types.Mutations/Extensions/ObjectFieldDefinitionExtensions.cs b/src/HotChocolate/Core/src/Types.Mutations/Extensions/ObjectFieldDefinitionExtensions.cs index ff553c4cb44..b4882d2c29f 100644 --- a/src/HotChocolate/Core/src/Types.Mutations/Extensions/ObjectFieldDefinitionExtensions.cs +++ b/src/HotChocolate/Core/src/Types.Mutations/Extensions/ObjectFieldDefinitionExtensions.cs @@ -40,7 +40,7 @@ public static void AddErrorType( throw new ArgumentNullException(nameof(errorType)); } - if (descriptorContext.ContextData[MutationContextDataKeys.Options] == null) + if (descriptorContext.ContextData.ContainsKey(MutationContextDataKeys.Options)) { var richMessage = string.Format( MutationConvention_ShouldBeEnabled_WhenAddingErrorType,