Skip to content

Commit

Permalink
Return early if no url passed into preload
Browse files Browse the repository at this point in the history
  • Loading branch information
daun committed Jan 26, 2024
1 parent d913300 commit f2e51e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ export default class SwupPreloadPlugin extends Plugin {
return;
}

// Return if no url passed in
if (!url) return;

// Already preloading? Return existing promise
if (this.preloadPromises.has(url)) {
return this.preloadPromises.get(url);
Expand Down

0 comments on commit f2e51e7

Please sign in to comment.