mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
use optional chaining
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user