Skip to content

Commit 1c35342

Browse files
committed
Prevents error on empty string check [fix]
1 parent dd44b01 commit 1c35342

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

htmlpreview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@
323323
for (let i = 0; i < link.length; ++i) {
324324
// Get absolute URL
325325
href = link[i].href;
326-
if (isGitForgeFileUrl(href)) {
326+
if (href != "" && isGitForgeFileUrl(href)) {
327327
// Then add it to links queue and fetch using CORS proxy
328328
links.push(fetchProxy(href, null, 0));
329329
}
@@ -343,7 +343,7 @@
343343
for (let i = 0; i < script.length; ++i) {
344344
// Get absolute URL
345345
src = script[i].src;
346-
if (isGitForgeFileUrl(src)) {
346+
if (src != "" && isGitForgeFileUrl(src)) {
347347
// Then add it to scripts queue and fetch using CORS proxy
348348
scripts.push(fetchProxy(src, null, 0));
349349
} else {

0 commit comments

Comments
 (0)