Skip to content

Commit 2a7dcd1

Browse files
author
Ives van Hoorne
committed
Help arme stakker
1 parent 530a228 commit 2a7dcd1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/pages/Sandbox/Editor/Workspace/Dependencies/ExternalResource.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const getNormalizedUrl = (url: string) => `${url.replace(/\/$/g, '')}/`;
2121

2222
function getName(resource: string) {
2323
if (resource.endsWith('.css') || resource.endsWith('.js')) {
24-
return resource.match(/.*\/(.*)/)[1];
24+
const match = resource.match(/.*\/(.*)/);
25+
26+
if (match && match[1]) return match[1];
2527
}
2628

2729
// Add trailing / but no double one

0 commit comments

Comments
 (0)