From 2a58f4f7e71a75f5cdcad1b866f96c6705185e19 Mon Sep 17 00:00:00 2001 From: Bryan Valverde U Date: Wed, 4 Sep 2024 16:06:54 -0600 Subject: [PATCH] Bump Rooster to patch (#2784) (#2785) * Resolve null sheet in convertInlineCss (#2784) * init * update * update version --- .../createModelFromHtml/convertInlineCss.ts | 18 ++++++++++-------- versions.json | 5 ++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/roosterjs-content-model-core/lib/command/createModelFromHtml/convertInlineCss.ts b/packages/roosterjs-content-model-core/lib/command/createModelFromHtml/convertInlineCss.ts index 2e70912a611..e26cae1c002 100644 --- a/packages/roosterjs-content-model-core/lib/command/createModelFromHtml/convertInlineCss.ts +++ b/packages/roosterjs-content-model-core/lib/command/createModelFromHtml/convertInlineCss.ts @@ -28,16 +28,18 @@ export function retrieveCssRules(doc: Document): CssRule[] { const result: CssRule[] = []; styles.forEach(styleNode => { - const sheet = styleNode.sheet as CSSStyleSheet; + const sheet = styleNode.sheet; - for (let ruleIndex = 0; ruleIndex < sheet.cssRules.length; ruleIndex++) { - const rule = sheet.cssRules[ruleIndex] as CSSStyleRule; + if (sheet) { + for (let ruleIndex = 0; ruleIndex < sheet.cssRules.length; ruleIndex++) { + const rule = sheet.cssRules[ruleIndex] as CSSStyleRule; - if (rule.type == CSSRule.STYLE_RULE && rule.selectorText) { - result.push({ - selectors: splitSelectors(rule.selectorText), - text: rule.style.cssText, - }); + if (rule.type == CSSRule.STYLE_RULE && rule.selectorText) { + result.push({ + selectors: splitSelectors(rule.selectorText), + text: rule.style.cssText, + }); + } } } diff --git a/versions.json b/versions.json index c4a78d6cd0d..51213f48705 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,8 @@ { "react": "9.0.0", "main": "9.9.1", - "legacyAdapter": "8.62.1" + "legacyAdapter": "8.62.1", + "overrides": { + "roosterjs-content-model-core": "9.9.2" + } }