add error message when timeline is empty throw a useful error message when the timeline is empty #853

This commit is contained in:
Josh de Leeuw 2020-10-21 17:41:53 -04:00
parent 94d4403be6
commit de175d5d52

View File

@ -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;