Skip to content

Commit

Permalink
fix: skip checking results for tasks that are not loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Tails128 authored and madbence committed Oct 6, 2020
1 parent ef9c14a commit 54d7bf1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rules/no-undefined-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const checkUndefinedResult = (pipeline, tekton, report) => (value, path, parent)
const matchingTask = pipeline.spec.tasks.find(t => t.name === task);
if (!matchingTask) return;

const taskSpec = matchingTask.taskRef ? tekton.tasks[matchingTask.taskRef.name].spec : matchingTask.taskSpec;
const hasTask = matchingTask.taskRef && tekton.tasks[matchingTask.taskRef.name];
const taskSpec = hasTask ? tekton.tasks[matchingTask.taskRef.name].spec : matchingTask.taskSpec;

const matchingResult = taskSpec.results.find(result => result.name === name);
if (!matchingResult) {
Expand Down

0 comments on commit 54d7bf1

Please sign in to comment.