miracle2k/webassets — pull request #360 by aconrad (2014-10-24 22:07:39+00:00)
Title: don't choke on empty files

If an empty file is passed through a filter, it will choke on it thinking that an empty string is not data. This PR fixes this problem by explicitly checking for `None` rather than making a falsy test:

```python
Traceback (most recent call last):
File "/opt/src/smlib.assets/smlib/assets/command.py", line 327, in compile_assets
env[bundle_name].urls()
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/bundle.py", line 787, in urls
urls.extend(bundle._urls(new_ctx, extra_filters, *args, **kwargs))
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/bundle.py", line 746, in _urls
*args, **kwargs)
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/bundle.py", line 600, in _build
force, disable_cache=disable_cache, extra_filters=extra_filters)
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/bundle.py", line 554, in _merge_and_apply
return filtertool.apply(final, selected_filters, 'output')
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/merge.py", line 277, in apply
return self._wrap_cache(key, func)
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/merge.py", line 219, in _wrap_cache
content = func().getvalue()
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/merge.py", line 252, in func
getattr(filter, type)(data, out, **kwargs_final)
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/filter/uglifyjs.py", line 32, in output
self.subprocess(args, out, _in)
File "/opt/webapp/anweb/local/lib/python2.7/site-packages/webassets/filter/__init__.py", line 505, in subprocess
'{input} placeholder given, but no data passed')
ValueError: {input} placeholder given, but no data passed
```