Skip to content

Commit

Permalink
fix get_head_img bug (littlecodersh#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwj718 authored and littlecodersh committed Mar 17, 2017
1 parent b4b2219 commit dd47af0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions itchat/components/contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ def get_head_img(self, userName=None, chatroomUserName=None, picDir=None):
return ReturnValue({'BaseResponse': {
'ErrMsg': 'No chatroom found',
'Ret': -1001, }})
if chatroom['EncryChatRoomId'] == '':
chatroom = self.update_chatroom(chatroomUserName)
params['chatroomid'] = chatroom['EncryChatRoomId']
if 'EncryChatRoomId' in chatroom:
params['chatroomid'] = chatroom['EncryChatRoomId']
params['chatroomid'] = params['chatroomid'] or chatroom['UserName']
headers = { 'User-Agent' : config.USER_AGENT }
r = self.s.get(url, params=params, stream=True, headers=headers)
tempStorage = io.BytesIO()
Expand Down

0 comments on commit dd47af0

Please sign in to comment.