prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  broken facebook link when no user_name
  If all we have is a user_id, we construct the URL improperly. In that case we need:
  
  `http://facebook.com/profile.php?id=$ID`
  
  But we have:
  
  `http://facebook.com/None`
  
  broken facebook link when no user_name
  If all we have is a user_id, we construct the URL improperly. In that case we need:
  
  `http://facebook.com/profile.php?id=$ID`
  
  But we have:
  
  `http://facebook.com/None`
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `gratipay/elsewhere/facebook.py`
  Content:
  ```
  1 from __future__ import absolute_import, division, print_function, unicode_literals
  2 
  3 from gratipay.elsewhere import PlatformOAuth2
  4 from gratipay.elsewhere._extractors import key
  5 
  6 
  7 class Facebook(PlatformOAuth2):
  8 
  9     # Platform attributes
  10     name = 'facebook'
  11     display_name = 'Facebook'
  12     account_url = 'https://www.facebook.com/{user_name}'
  13 
  14     # Auth attributes
  15     auth_url = 'https://www.facebook.com/dialog/oauth'
  16     access_token_url = 'https://graph.facebook.com/oauth/access_token'
  17     oauth_default_scope = ['public_profile,email']
  18 
  19     # API attributes
  20     api_format = 'json'
  21     api_url = 'https://graph.facebook.com'
  22     api_user_info_path = '/{user_name}'
  23     api_user_self_info_path = '/me'
  24 
  25     # User info extractors
  26     x_user_id = key('id')
  27     x_user_name = key('username')
  28     x_display_name = key('name')
  29     x_email = key('email')
  30 
  31     def x_avatar_url(self, extracted, info, default):
  32         return 'https://graph.facebook.com/' + extracted.user_id + '/picture?width=256&height=256'
  33
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/gratipay/elsewhere/facebook.py b/gratipay/elsewhere/facebook.py
  --- a/gratipay/elsewhere/facebook.py
  +++ b/gratipay/elsewhere/facebook.py
  @@ -9,7 +9,7 @@
       # Platform attributes
       name = 'facebook'
       display_name = 'Facebook'
  -    account_url = 'https://www.facebook.com/{user_name}'
  +    account_url = 'https://www.facebook.com/profile.php?id={user_id}'
   
       # Auth attributes
       auth_url = 'https://www.facebook.com/dialog/oauth'
  
verification_info: {"golden_diff": "diff --git a/gratipay/elsewhere/facebook.py b/gratipay/elsewhere/facebook.py\n--- a/gratipay/elsewhere/facebook.py\n+++ b/gratipay/elsewhere/facebook.py\n@@ -9,7 +9,7 @@\n     # Platform attributes\n     name = 'facebook'\n     display_name = 'Facebook'\n-    account_url = 'https://www.facebook.com/{user_name}'\n+    account_url = 'https://www.facebook.com/profile.php?id={user_id}'\n \n     # Auth attributes\n     auth_url = 'https://www.facebook.com/dialog/oauth'\n", "issue": "broken facebook link when no user_name\nIf all we have is a user_id, we construct the URL improperly. In that case we need:\n\n`http://facebook.com/profile.php?id=$ID`\n\nBut we have:\n\n`http://facebook.com/None`\n\nbroken facebook link when no user_name\nIf all we have is a user_id, we construct the URL improperly. In that case we need:\n\n`http://facebook.com/profile.php?id=$ID`\n\nBut we have:\n\n`http://facebook.com/None`\n\n", "before_files": [{"content": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom gratipay.elsewhere import PlatformOAuth2\nfrom gratipay.elsewhere._extractors import key\n\n\nclass Facebook(PlatformOAuth2):\n\n    # Platform attributes\n    name = 'facebook'\n    display_name = 'Facebook'\n    account_url = 'https://www.facebook.com/{user_name}'\n\n    # Auth attributes\n    auth_url = 'https://www.facebook.com/dialog/oauth'\n    access_token_url = 'https://graph.facebook.com/oauth/access_token'\n    oauth_default_scope = ['public_profile,email']\n\n    # API attributes\n    api_format = 'json'\n    api_url = 'https://graph.facebook.com'\n    api_user_info_path = '/{user_name}'\n    api_user_self_info_path = '/me'\n\n    # User info extractors\n    x_user_id = key('id')\n    x_user_name = key('username')\n    x_display_name = key('name')\n    x_email = key('email')\n\n    def x_avatar_url(self, extracted, info, default):\n        return 'https://graph.facebook.com/' + extracted.user_id + '/picture?width=256&height=256'\n", "path": "gratipay/elsewhere/facebook.py"}], "after_files": [{"content": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom gratipay.elsewhere import PlatformOAuth2\nfrom gratipay.elsewhere._extractors import key\n\n\nclass Facebook(PlatformOAuth2):\n\n    # Platform attributes\n    name = 'facebook'\n    display_name = 'Facebook'\n    account_url = 'https://www.facebook.com/profile.php?id={user_id}'\n\n    # Auth attributes\n    auth_url = 'https://www.facebook.com/dialog/oauth'\n    access_token_url = 'https://graph.facebook.com/oauth/access_token'\n    oauth_default_scope = ['public_profile,email']\n\n    # API attributes\n    api_format = 'json'\n    api_url = 'https://graph.facebook.com'\n    api_user_info_path = '/{user_name}'\n    api_user_self_info_path = '/me'\n\n    # User info extractors\n    x_user_id = key('id')\n    x_user_name = key('username')\n    x_display_name = key('name')\n    x_email = key('email')\n\n    def x_avatar_url(self, extracted, info, default):\n        return 'https://graph.facebook.com/' + extracted.user_id + '/picture?width=256&height=256'\n", "path": "gratipay/elsewhere/facebook.py"}]}