[go: up one dir, main page]

Skip to content

initHighlightWorker throws TypeError

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

initHighlightWorker throws:

Cannot read properties of undefined (reading 'endsWith')

when name destructured from blob is undefined.

Example (internal only)

Solution

Handle situations where an empty object is passed as blob. See BlobContentViewer:

result({ data }) {
        ...
        this.blobInfo = repository.blobs?.nodes[0] || {};
        ...
        this.initHighlightWorker(this.blobInfo, this.isUsingLfs);
      },
Edited by 🤖 GitLab Bot 🤖