Skip to content

Commit

Permalink
removes unnecessary conditional (#1777)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavacava authored Nov 1, 2024
1 parent cf37601 commit 9cd8631
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions backend/models/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,11 +783,7 @@ func (db *Database) GetDiggerJobFromRunStage(stage DiggerRunStage) (*DiggerJob,
job := &DiggerJob{}
result := db.GormDB.Preload("Batch").Take(job, "batch_id = ?", stage.BatchID)
if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
return nil, result.Error
} else {
return nil, result.Error
}
return nil, result.Error
}
return job, nil
}
Expand Down

0 comments on commit 9cd8631

Please sign in to comment.