Skip to content

Commit b1fc947

Browse files
authored
bugfix: Fix the NPE when focusing on the output channel (#341)
1 parent 6a22293 commit b1fc947

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/views/dependencyExplorer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@ export class DependencyExplorer implements Disposable {
2222

2323
private _dataProvider: DependencyDataProvider;
2424

25+
private readonly SUPPORTED_URI_SCHEMES: string[] = ["file", "jdt"];
26+
2527
constructor(public readonly context: ExtensionContext) {
2628
this._dataProvider = new DependencyDataProvider(context);
2729
this._dependencyViewer = window.createTreeView("javaProjectExplorer", { treeDataProvider: this._dataProvider, showCollapseAll: true });
2830

2931
context.subscriptions.push(
3032
window.onDidChangeActiveTextEditor((textEditor: TextEditor) => {
3133
if (this._dependencyViewer.visible && textEditor && textEditor.document && Settings.syncWithFolderExplorer()) {
32-
this.reveal(textEditor.document.uri);
34+
const uri: Uri = textEditor.document.uri;
35+
if (this.SUPPORTED_URI_SCHEMES.includes(uri.scheme)) {
36+
this.reveal(uri);
37+
}
3338
}
3439
}),
3540
);

0 commit comments

Comments
 (0)