mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-19 02:34:20 -05:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user