Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

NullReferenceException in SqlConnection.UseLocally

Open
#428 2 comments 0 reactions 1 assignee View on GitHub

@smoothdeveloper is already working on this.

Since Jun 23, 2023.

Assessment

This issue has not been assessed yet.

Description

bug
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>[email protected](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
Dominant language
F#
Stars
206
Forks
66
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/FSharp.Data.SqlClient

All issues in fsprojects/FSharp.Data.SqlClient

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.