Homec4science

Fix an exception in Tokens if a bad object was given a token

Authored by epriestley <git@epriestley.com> on Dec 28 2015, 21:59.

Description

Fix an exception in Tokens if a bad object was given a token

Summary:
Fixes T10057. Root issue is:

  • In the past, you could give tokens to objects of type X (here, Ponder answers).
  • Now, you can't.
  • If you try to load a token on an object of type X, we do a bad call to attach it and fatal.

Instead, make sure objects implement the proper interface before we attach them, and just pretend the token does not exist otherwise.

Test Plan: Faked the exception in T10057, applied patch, got clean tokens page.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10057

Differential Revision: https://secure.phabricator.com/D14905

Details

Committed
epriestley <git@epriestley.com>Dec 28 2015, 22:28
Pushed
aubortJan 31 2017, 17:16
Parents
rPHabd60eeee0e6: Rough data fetch for previous/next posts on a blog
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH33384abff78a: Fix an exception in Tokens if a bad object was given a token (authored by epriestley <git@epriestley.com>).Dec 28 2015, 22:28