From 1263963c652a128d57363315f84842b5342299f5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 13 2015 16:26:39 +0000 Subject: Make the jinja filters a little more robust --- diff --git a/progit/__init__.py b/progit/__init__.py index de59a40..4e23601 100644 --- a/progit/__init__.py +++ b/progit/__init__.py @@ -244,6 +244,9 @@ def format_ts(string): def format_loc(loc, commit=None, prequest=None, index=None): """ Template filter putting the provided lines of code into a table """ + if loc is None: + return + output = [ '
', '' @@ -385,6 +388,8 @@ def markdown_filter(text): @APP.template_filter('html_diff') def html_diff(diff): """Display diff as HTML""" + if diff is None: + return return highlight( diff, DiffLexer(),