Skip to content

Commit

Permalink
add task InventoryID is null use Template.InventoryID
Browse files Browse the repository at this point in the history
  • Loading branch information
warlocgao committed Aug 20, 2024
1 parent 078034d commit 73e8394
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion services/tasks/TaskRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (t *TaskRunner) populateDetails() error {
}

// get inventory
if t.Task.InventoryID!=nil{
if t.Task.InventoryID != nil {
t.Inventory, err = t.pool.store.GetInventory(t.Template.ProjectID, *t.Task.InventoryID)
if err != nil {
if t.Template.InventoryID != nil {
Expand All @@ -259,6 +259,13 @@ func (t *TaskRunner) populateDetails() error {
}
}
}
} else {
if t.Template.InventoryID != nil {
t.Inventory, err = t.pool.store.GetInventory(t.Template.ProjectID, *t.Template.InventoryID)
if err != nil {
return t.prepareError(err, "Template Inventory not found!")
}
}
}

// get repository
Expand Down

0 comments on commit 73e8394

Please sign in to comment.