search: defensive nil-check for and-results
Created by: rvantonder
This is a defensive change to check whether result
is nil before it is potentially accessed like result.limitHit
in this function. I believe it is hard, but not impossible, to induce the value of nil
for result
here, but haven't been able to trigger it (the value depends on evaluateLeaf
, our base search logic, and not something dependent on operators). The ideal solution would be to ensure that result is non-nil (pagination ensures this, for example), but that change would be too involved right now.
This change is checked against search integration tests, and again, it's a defensive change so shouldn't have any meaningful impact to logic.