From 13c2043af8a6d82f8260ea8d190b1e4c0624f1f7 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Mon, 23 May 2011 11:49:42 -0700 Subject: handle cases when text is a NoneType --- debug_toolbar/utils/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index 3f035e6..2ce38db 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -36,7 +36,11 @@ def tidy_stacktrace(stack): continue if socketserver_path in s_path: continue - trace.append((path, line_no, func_name, (''.join(text)).strip())) + if not text: + text = '' + else: + text = (''.join(text)).strip() + trace.append((path, line_no, func_name, text)) return trace def get_template_info(source, context_lines=3): -- cgit v1.2.3