Skip to content

Commit 5a21745

Browse files
committed
fix empty tasks failure
1 parent 67d823c commit 5a21745

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/reducers/tutorial/config-paths.js

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ function configTestString(dir, name, config, testPath) {
1818
}
1919
function configPaths(dir, name, config, pages) {
2020
return pages.map(function (page) {
21+
if (!page.tasks) {
22+
page.tasks = [];
23+
}
2124
page.tasks.map(function (task) {
2225
task.tests = task.tests.map(function (testPath) {
2326
if (typeof testPath === 'string') {

src/reducers/tutorial/config-paths.ts

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export default function configPaths(
2525
dir: string, name: string, config: Tutorial.Config, pages: CR.Page[]
2626
): CR.Page[] {
2727
return pages.map((page: CR.Page): CR.Page => {
28+
if (!page.tasks) {
29+
page.tasks = [];
30+
}
2831
page.tasks.map((task: CR.Task): CR.Task => {
2932
// change testPaths to use absolute URLs
3033
task.tests = task.tests.map((testPath: string) => {

0 commit comments

Comments
 (0)