Skip to content

Unhandled error #242

Closed
Closed
@dholbach

Description

@dholbach

From Ada Logics:

Unhandled error in the image-automation controller, despite the error being assigned to a variable, which can lead to undefined behaviour.

var signingEntity *openpgp.Entity
if gitSpec.Commit.SigningKey != nil {
signingEntity, err = r.getSigningEntity(ctx, auto)
}

Recommendation
We propose to change the above code to the following:

var signingEntity *openpgp.Entity
if gitSpec.Commit.SigningKey != nil {
    if signingEntity, err = r.getSigningEntity(ctx, auto); err != nil {
        failWithError(err)
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions