Skip to content

Potential type assertion panic in logRefreshConnectionResults #4807

@e-gineer

Description

@e-gineer

Description

At line 309, code performs type assertion without checking:

var cmdName = viper.Get(constants.ConfigKeyActiveCommand).(*cobra.Command).Name()

Multiple failure points: viper.Get() could return nil, value might not be *cobra.Command, or pointer could be nil.

Severity

LOW - Panic in logging code

Suggested Fix

Use safe type assertion with ok pattern.

Related Code

  • pkg/connection/refresh_connections_state.go:309

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