Skip to content

Commit

Permalink
use optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Sep 11, 2020
1 parent 3e71592 commit 8a6b38e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/base/browser/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,11 @@ function getSharedStyleSheet(): HTMLStyleElement {
}

function getDynamicStyleSheetRules(style: any) {
if (style && style.sheet && style.sheet.rules) {
if (style?.sheet?.rules) {
// Chrome, IE
return style.sheet.rules;
}
if (style && style.sheet && style.sheet.cssRules) {
if (style?.sheet?.cssRules) {
// FF
return style.sheet.cssRules;
}
Expand Down

0 comments on commit 8a6b38e

Please sign in to comment.