From 1c9ca30d6f1610a36c5e7754b87e3f585227e0fe Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Mon, 28 Jun 2021 13:16:58 -0400 Subject: [PATCH] return 0 when no gazeData (possibly fixes #1724) --- plugins/jspsych-webgazer-validate.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/jspsych-webgazer-validate.js b/plugins/jspsych-webgazer-validate.js index c014ae05..e25224a2 100644 --- a/plugins/jspsych-webgazer-validate.js +++ b/plugins/jspsych-webgazer-validate.js @@ -241,6 +241,9 @@ function calculateSampleRate(gazeData){ var mean_diff = []; + if(gazeData.length == 0){ + return 0; + } for(var i=0; i 1){ var t_diff = []; @@ -255,7 +258,6 @@ } else { return null; } - } function validation_done(){