Skip to content

Commit

Permalink
fix occasional error notification in the language server when reading…
Browse files Browse the repository at this point in the history
… notebook file contents from disk
  • Loading branch information
DetachHead committed Feb 13, 2025
1 parent bd61a24 commit 9fa8b83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pyright-internal/src/analyzer/sourceFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ export class SourceFile {
let source;
try {
//TODO: this isnt ideal because it re-reads the file for each cell which is unnecessary
source = getIPythonCells(this.fileSystem, this.getRealUri(), this._console)?.[cellIndex].source;
source = getIPythonCells(this.fileSystem, this.getRealUri(), this._console)?.[cellIndex]?.source;
} catch (e) {
this._console.error(e instanceof Error ? e.message : String(e));
}
Expand Down

0 comments on commit 9fa8b83

Please sign in to comment.