File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
libraries/load-themed-styles/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -164,9 +164,6 @@ function initializeThemeState(): IThemeState {
164164 * @param {boolean } loadAsync When true, always load styles in async mode, irrespective of current sync mode.
165165 */
166166export function loadStyles ( styles : string | ThemableArray , loadAsync : boolean = false ) : void {
167- if ( typeof document === 'undefined' ) {
168- return ;
169- }
170167 measure ( ( ) => {
171168 const styleParts : ThemableArray = Array . isArray ( styles ) ? styles : splitStyles ( styles ) ;
172169 if ( _injectStylesWithCssText === undefined ) {
@@ -424,6 +421,9 @@ function registerStyles(styleArray: ThemableArray): void {
424421 * @param {IStyleRecord } styleRecord May specify a style Element to update.
425422 */
426423function registerStylesIE ( styleArray : ThemableArray , styleRecord ?: IStyleRecord ) : void {
424+ if ( typeof document === 'undefined' ) {
425+ return ;
426+ }
427427 const head : HTMLHeadElement = document . getElementsByTagName ( 'head' ) [ 0 ] ;
428428 const registeredStyles : IStyleRecord [ ] = _themeState . registeredStyles ;
429429 let lastStyleElement : IExtendedHtmlStyleElement = _themeState . lastStyleElement ;
You can’t perform that action at this time.
0 commit comments