mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 23:08:22 -05:00
Fix 500 error when attempting to subscribe to a non-existent subreddit.
This commit is contained in:
@@ -1940,7 +1940,7 @@ class ApiController(RedditController):
|
||||
def POST_subscribe(self, action, sr):
|
||||
# only users who can make edits are allowed to subscribe.
|
||||
# Anyone can leave.
|
||||
if action != 'sub' or sr.can_comment(c.user):
|
||||
if sr and (action != 'sub' or sr.can_comment(c.user)):
|
||||
self._subscribe(sr, action == 'sub')
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user