Skip to content

fix #521: add null check before accessing javaExt.exports - #525

Merged
Yan Zhang (Eskibear) merged 2 commits into
microsoft:masterfrom
Eskibear:fix-521
Dec 15, 2020
Merged

Yan Zhang (Eskibear) merged 2 commits into
microsoft:masterfrom
Eskibear:fix-521

Conversation

@Eskibear

Copy link
Copy Markdown
Member

fix #521

Comment thread src/java-runtime/index.ts Outdated
// refresh webview with latest source levels when classpath (project info) changes
const javaExt = vscode.extensions.getExtension("redhat.java");
if (javaExt && javaExt.isActive && javaExt.exports.onDidClasspathUpdate) {
if (javaExt && javaExt.isActive && javaExt.exports && javaExt.exports.onDidClasspathUpdate) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javaExt?.isActive && javaExt?.exports?.onDidClasspathUpdate

Signed-off-by: Yan Zhang <[email protected]>
@Eskibear
Yan Zhang (Eskibear) merged commit 506a01d into microsoft:master Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Cannot read property 'onDidClasspathUpdate' of undefined" error when opening Java runtime guide

2 participants