Skip to content

Commit 74a7835

Browse files
committed
Fixed privacy plugin crashing on non-existent file
1 parent 00b0b5b commit 74a7835

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

material/plugins/privacy/plugin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,11 @@ def on_post_build(self, *, config):
200200
self._patch, file
201201
))
202202

203-
# Otherwise just copy external asset to output directory
203+
# Otherwise just copy external asset to output directory if it
204+
# exists, i.e., if the download succeeded
204205
else:
205-
file.copy_file()
206+
if os.path.exists(file.abs_src_path):
207+
file.copy_file()
206208

207209
# Reconcile concurrent jobs for the last time, so the plugins following
208210
# in the build process always have a consistent state to work with

src/plugins/privacy/plugin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,11 @@ def on_post_build(self, *, config):
200200
self._patch, file
201201
))
202202

203-
# Otherwise just copy external asset to output directory
203+
# Otherwise just copy external asset to output directory if it
204+
# exists, i.e., if the download succeeded
204205
else:
205-
file.copy_file()
206+
if os.path.exists(file.abs_src_path):
207+
file.copy_file()
206208

207209
# Reconcile concurrent jobs for the last time, so the plugins following
208210
# in the build process always have a consistent state to work with

0 commit comments

Comments
 (0)