Fix rendering empty files
The first if checks if we can encode the text, if we can then it's a file
otherwise we treat it as binary.
However, we were doing ``if file_content`` as the file_content variable
is set when the encoding works.
However, in the case of an empty file, we could encode it so we have
a valid ``file_content`` variable which contains... an empty string.
So it would fail the ``if file_content`` check.
We fix this by simply changing the check to ``if file_content is not None``
then we're sure the encoding worked and we do not care if the content
is an empty string or not.