Skip to content
Snippets Groups Projects

Search backend: fix issues with null and zero-length offsetAndLength

Merged Warren Gifford requested to merge cc/fix-to-line-matches into main

Created by: camdencheek

The code that converts ChunkMatch into []LineMatch treats zero-length matches as valid, which they are. However, it's not expected that a LineMatch has zero-length or nil offsetAndLengths. To maintain backwards compatibility, I've udpated the conversion function to stop generating line matches like this.

Test plan

Added a test case for this. Also tested manually that it fixed the browser crash from null offsetAndLength.

Proof that it fixes the issue: Screen Shot 2022-06-03 at 15 28 03

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
Please register or sign in to reply
Loading