mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-11 11:29:42 +02:00
Fix a bug in CSS cloning error handler
Firefox throws SecurityError when `cssRules` is accessed, which exposes this bug. Fixes #245
This commit is contained in:
@@ -80,8 +80,8 @@ var cloneCssStyles = function(svg, classes){
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
if(rule !== 'undefined'){
|
||||
catch (err) {
|
||||
if (typeof(rule) !== 'undefined') {
|
||||
log.warn('Invalid CSS selector "' + rule.selectorText + '"', err);
|
||||
}
|
||||
}
|
||||
@@ -134,4 +134,4 @@ var cloneCssStyles = function(svg, classes){
|
||||
}
|
||||
};
|
||||
|
||||
export {cloneCssStyles};
|
||||
export {cloneCssStyles};
|
||||
|
Reference in New Issue
Block a user