Skip to content

Operations may not handle nil sessions map after Close() #4809

@e-gineer

Description

@e-gineer

Description

After Close() sets c.sessions = nil, any operation that tries to access the sessions map will access a nil map. While Go allows reading from a nil map, the pattern is fragile.

Severity

LOW - Fragile code pattern

Test Reference

Test: TestDbClient_SessionsMapNilAfterClose in pkg/db/db_client/db_client_test.go:388 (skipped)

Suggested Fix

All session access should check if the map is nil.

Related Code

  • Multiple session access points in pkg/db/db_client/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions