From de175d5d5257c882e80309475ebc8b24a29d78e5 Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Wed, 21 Oct 2020 17:41:53 -0400 Subject: [PATCH] add error message when timeline is empty throw a useful error message when the timeline is empty #853 --- jspsych.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jspsych.js b/jspsych.js index eb5d3f80..dd844378 100755 --- a/jspsych.js +++ b/jspsych.js @@ -57,6 +57,10 @@ window.jsPsych = (function() { console.error('No timeline declared in jsPsych.init. Cannot start experiment.') } + if(options.timeline.length == 0){ + console.error('No trials have been added to the timeline (the timeline is an empty array). Cannot start experiment.') + } + // reset variables timeline = null; global_trial_index = 0;