From 22c75cf7486cbce8db3d06aa255e8e5db76e4d9c Mon Sep 17 00:00:00 2001 From: ichuang Date: Thu, 17 May 2012 22:39:20 -0400 Subject: [PATCH] make courseware/capa/util.py contextualize_text return gracefully if text = None --- djangoapps/courseware/capa/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/djangoapps/courseware/capa/util.py b/djangoapps/courseware/capa/util.py index b85073d78c..d042aa21d3 100644 --- a/djangoapps/courseware/capa/util.py +++ b/djangoapps/courseware/capa/util.py @@ -1,6 +1,7 @@ def contextualize_text(text, context): # private ''' Takes a string with variables. E.g. $a+$b. Does a substitution of those variables from the context ''' + if not text: return text for key in sorted(context, lambda x,y:cmp(len(y),len(x))): text=text.replace('$'+key, str(context[key])) return text