Skip to content

Commit

Permalink
Prevent undefined if searcher hasn been run yet
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Dec 6, 2024
1 parent 7cb1f55 commit cb9e3f4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/assets/javascripts/controllers/searchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,16 @@ angular.module('QuepidApp')

$scope.querqyRuleTriggered = function () {
let triggered = false;
let parsedQueryDetails = $scope.query.searcher.parsedQueryDetails;

if (parsedQueryDetails.querqy?.rewrite !== undefined) { // jshint ignore:line
triggered = true;
}
else if ('querqy.infoLog' in parsedQueryDetails){
triggered = true;
if ($scope.query.searcher && $scope.query.searcher.parsedQueryDetails) {
let parsedQueryDetails = $scope.query.searcher.parsedQueryDetails;

if (parsedQueryDetails.querqy?.rewrite !== undefined) { // jshint ignore:line
triggered = true;
}
else if ('querqy.infoLog' in parsedQueryDetails){
triggered = true;
}
}

return triggered;
Expand Down

0 comments on commit cb9e3f4

Please sign in to comment.