File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,11 @@ def _parse_media(self, initiator: File) -> list[URL]:
268268 if extension not in self .assets_expr_map :
269269 return []
270270
271+ # Skip if source path is not set, which might be true for generated
272+ # files or for files that were added programatically in plugins
273+ if not initiator .abs_src_path :
274+ return []
275+
271276 # Find and extract all external asset URLs
272277 expr = re .compile (self .assets_expr_map [extension ], flags = re .I | re .M )
273278 with open (initiator .abs_src_path , encoding = "utf-8-sig" ) as f :
Original file line number Diff line number Diff line change @@ -268,6 +268,11 @@ def _parse_media(self, initiator: File) -> list[URL]:
268268 if extension not in self .assets_expr_map :
269269 return []
270270
271+ # Skip if source path is not set, which might be true for generated
272+ # files or for files that were added programatically in plugins
273+ if not initiator .abs_src_path :
274+ return []
275+
271276 # Find and extract all external asset URLs
272277 expr = re .compile (self .assets_expr_map [extension ], flags = re .I | re .M )
273278 with open (initiator .abs_src_path , encoding = "utf-8-sig" ) as f :
You can’t perform that action at this time.
0 commit comments