Skip to content

Commit 2b1bfbb

Browse files
committed
Resolve SonarQube warnings.
1 parent 7a2cc4c commit 2b1bfbb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/dom-to-image-more.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@
916916
let placeholder;
917917
if (domtoimage.impl.options.imagePlaceholder) {
918918
const split = domtoimage.impl.options.imagePlaceholder.split(/,/);
919-
if (split && split[1]) {
919+
if (split?.[1]) {
920920
placeholder = split[1];
921921
}
922922
}
@@ -1165,7 +1165,7 @@
11651165
function newWebFont(webFontRule) {
11661166
return {
11671167
resolve: function resolve() {
1168-
const baseUrl = (webFontRule.parentStyleSheet || {}).href;
1168+
const baseUrl = webFontRule.parentStyleSheet?.href;
11691169
return inliner.inlineAll(webFontRule.cssText, baseUrl);
11701170
},
11711171
src: function () {
@@ -1506,6 +1506,7 @@
15061506
sandbox.setAttribute('srcdoc', sandboxHTML);
15071507
return sandbox.contentWindow;
15081508
} catch (_) {
1509+
// NOSONAR
15091510
// swallow exception and fall through to the simplest path
15101511
}
15111512

0 commit comments

Comments
 (0)