From 05ee6783625f860230e235ba7d45190572abecd4 Mon Sep 17 00:00:00 2001 From: Keith Mitchell Date: Fri, 31 Aug 2012 10:15:14 -0700 Subject: [PATCH] Check for c.user before grabbing pref_local_js During some errors, additional tracebacks were being generated due to the attempted reference to c.user before it had been properly set. This should protect against that and let the proper errors go through. --- r2/r2/lib/js.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r2/r2/lib/js.py b/r2/r2/lib/js.py index 037567f92..f076b90fe 100755 --- a/r2/r2/lib/js.py +++ b/r2/r2/lib/js.py @@ -252,7 +252,7 @@ class JQuery(Module): def use(self): from r2.lib.template_helpers import static - if c.secure or c.user.pref_local_js: + if c.secure or (c.user and c.user.pref_local_js): return Module.use(self) else: ext = ".js" if g.uncompressedJS else ".min.js"