Skip to content

Fix DBNull cast error in Lite database_config collector (fixes #192)#204

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/lite-dbconfig-dbnull-192
Feb 20, 2026
Merged

Fix DBNull cast error in Lite database_config collector (fixes #192)#204
erikdarlingdata merged 1 commit intodevfrom
fix/lite-dbconfig-dbnull-192

Conversation

@erikdarlingdata
Copy link
Owner

Summary

  • On SQL Server 2016 Express, certain sys.databases columns can return NULL unexpectedly
  • All GetBoolean() and Convert.ToInt32() reads now check IsDBNull first, defaulting to false/0
  • Prevents "Object cannot be cast from DBNull to other types" error in collection health

Test plan

  • Lite builds cleanly
  • Needs confirmation from reporter on SQL Server 2016 Express (we don't have Express installed)

🤖 Generated with Claude Code

…xpress (fixes #192)

All GetBoolean() and Convert.ToInt32() calls now check IsDBNull first,
defaulting to false/0. Prevents "Object cannot be cast from DBNull to
other types" on editions where certain sys.databases columns return NULL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 0962746 into dev Feb 20, 2026
3 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/lite-dbconfig-dbnull-192 branch February 20, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant