Skip to content

HC throws NullReferenceException after updating from 13.7.0 to 13.8.1 #6797

@jhpetersen

Description

@jhpetersen

Is there an existing issue for this?

  • I have searched the existing issues

Product

Hot Chocolate

Describe the bug

After updating HC from 13.7.0 to 13.8.1 a NullReferenceException is thrown on startup initialization.

The stacktrace (see relevant log output) shows MutationConventionTypeInterceptor.TryApplyInputConvention, for which changes were made in https://github.com/ChilliCream/graphql-platform/pull/6776/files.
So i suspect there was introduced a bug not checking for possible null values?

Steps to reproduce

https://github.com/jhpetersen/HC13.8_MutationConventionEnumIssue

Sadly i don't have any clue, from which type this exception actually gets thrown, so i can not provide a minimal repo to reproduce this, but reverting to HC 13.7.0 fixes this error.
I hope the stacktrace and the hint on the aforementioned PR6776 could assist enough to find the cause.

Relevant log output

Object reference not set to an instance of an object.
   bei HotChocolate.Types.EnumType.ParseValue(Object runtimeValue)
   bei HotChocolate.Types.InputFormatter.FormatValueLeaf(Object runtimeValue, ILeafType type, Path path)
   bei HotChocolate.Types.MutationConventionTypeInterceptor.TryApplyInputConvention(IResolverCompiler resolverCompiler, ObjectFieldDefinition mutation, Options options)
   bei HotChocolate.Types.MutationConventionTypeInterceptor.OnBeforeCompleteMutation(ITypeCompletionContext completionContext, ObjectTypeDefinition definition)
   bei HotChocolate.Configuration.TypeInitializer.MergeTypeExtensions()
   bei HotChocolate.Configuration.TypeInitializer.Initialize()
   bei HotChocolate.SchemaBuilder.Setup.InitializeTypes(SchemaBuilder builder, IDescriptorContext context, IReadOnlyList`1 types)
   bei HotChocolate.SchemaBuilder.Setup.Create(SchemaBuilder builder, LazySchema lazySchema, IDescriptorContext context)
   bei HotChocolate.Execution.RequestExecutorResolver.<CreateSchemaAsync>d__19.MoveNext()
   bei HotChocolate.Execution.RequestExecutorResolver.<CreateSchemaServicesAsync>d__18.MoveNext()
   bei HotChocolate.Execution.RequestExecutorResolver.<GetRequestExecutorNoLockAsync>d__14.MoveNext()
   bei HotChocolate.Execution.RequestExecutorResolver.<GetRequestExecutorAsync>d__13.MoveNext()
   bei HotChocolate.AspNetCore.Warmup.ExecutorWarmupService.<ExecuteAsync>d__5.MoveNext()
   bei Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__12.MoveNext()
   bei Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   bei Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   bei Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   bei Microsoft.AspNetCore.Builder.WebApplication.Run(String url)
   bei Program.<<Main>$>d__0.MoveNext()

Additional Context?

No response

Version

13.8.1

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions