Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Gracefully fail if recent clicks cookie contains NotFound thing.

  • Loading branch information...
commit 50a0088d159550620831960e161290e43c5e87fc 1 parent 474c369
@spladug spladug authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 r2/r2/controllers/reddit_base.py
View
9 r2/r2/controllers/reddit_base.py
@@ -162,8 +162,13 @@ def set_recent_clicks():
set_user_cookie('recentclicks2', ','.join(names))
#eventually this will look at the user preference
names = names[:5]
- c.recent_clicks = Link._by_fullname(names, data = True,
- return_dict = False)
+
+ try:
+ c.recent_clicks = Link._by_fullname(names, data = True,
+ return_dict = False)
+ except NotFound:
+ # clear their cookie because it's got bad links in it
+ set_user_cookie('recentclicks2', '')
else:
#if the cookie wasn't valid, clear it
set_user_cookie('recentclicks2', '')
Please sign in to comment.
Something went wrong with that request. Please try again.