Skip to content

Commit

Permalink
Merge pull request #736 from alrusdi/vk-workflow-fix
Browse files Browse the repository at this point in the history
VK API workflow fix if error happens on vk-side
  • Loading branch information
omab committed Sep 25, 2015
2 parents 8c70e49 + bfeb34d commit e9bdf71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions social/backends/vk.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def user_data(self, access_token, *args, **kwargs):
'fields': fields,
})

if data.get('error'):
if data and data.get('error'):
error = data['error']
msg = error.get('error_msg', 'Unknown error')
if error.get('error_code') == 5:
Expand All @@ -122,7 +122,7 @@ def user_data(self, access_token, *args, **kwargs):
if data:
data = data.get('response')[0]
data['user_photo'] = data.get('photo') # Backward compatibility
return data
return data or {}


class VKAppOAuth2(VKOAuth2):
Expand Down

0 comments on commit e9bdf71

Please sign in to comment.