Skip to content

Commit

Permalink
Gracefully handle the case in which there are no user inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
shankari committed May 27, 2022
1 parent e8c1321 commit 0ccab07
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions www/js/survey/input-matcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ angular.module('emission.survey.inputmatcher', ['emission.plugin.logger'])
// If there is only one item in the list, return it.
// This make it compatible when fake list is given (for Enketo Survey).
// As well as optimize the performance.
if (userInputList === undefined) {
Logger.log("In getUserInputForTrip, no user input, returning []");
return undefined;
}

if (userInputList.length === 1) {
return userInputList[0];
}
Expand Down

0 comments on commit 0ccab07

Please sign in to comment.