Skip to content

Commit

Permalink
handle filter failures in binary files
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Mar 9, 2016
1 parent 6e22244 commit 7a8e260
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nikola/filters.py
Expand Up @@ -57,8 +57,11 @@ def f_in_file(fname):
with open(fname, 'rb') as inf:
data = inf.read()
data = f(data)
with open(fname, 'wb+') as outf:
outf.write(data)
if data is not False:
with open(fname, 'wb+') as outf:
outf.write(data)
else:
return False

return f_in_file

Expand Down

0 comments on commit 7a8e260

Please sign in to comment.