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.
This commit is contained in:
Keith Mitchell
2012-08-31 10:15:14 -07:00
parent 127e890f5e
commit 05ee678362

View File

@@ -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"