Skip to content

NullReferenceException in SqlConnection.UseLocally #428

@daniellittledev

Description

@daniellittledev

Issue Summary

I've run into a NullReferenceException internal to FSharp.Data.SqlClient.

To Reproduce

I'm not exactly sure of how to reproduce it but it's possibly caused by a timeout or database error.

Error

System.NullReferenceException: Object reference not set to an instance of an object. at
FSharp.Data.SqlClient.Internals.Extensions.SqlConnection.UseLocally(SqlConnection this, FSharpOption`1 privateConnection) at
<StartupCode$FSharp-Data-SqlClient>.$ISqlCommand.AsyncExecuteNonQuery@374.Invoke(Unit unitVar) at
Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 508

Expected behavior

I would expect to see a database error, not a null reference inside FSharp.Data.SqlClient.

What you can do

  • [] I am willing to contribute a PR with a unit test showcasing the issue
  • I am willing to test the bug fix before next release

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions