fbchat
fbchat copied to clipboard
Client.isLoggedIn() raises "AttributeError: 'NoneType' object has no attribute 'is_logged_in'"
Description of the problem
Client.isLoggedIn() raises AttributeError: 'NoneType' object has no attribute 'is_logged_in'
referring to the Client._state property.
Code to reproduce
client = fb.Client('[email protected]', 'mypassword')
client.logout()
print('Logged status: {}'.format(client.isLoggedIn()))
Traceback
AttributeError Traceback (most recent call last)
<ipython-input-31-9afa70e6a12f> in <module>
----> 1 client.isLoggedIn()
~/.virtualenvs/fbchat/lib/python3.8/site-packages/fbchat/_client.py in isLoggedIn(self)
152 bool: True if the client is still logged in
153 """
--> 154 return self._state.is_logged_in()
155
156 def getSession(self):
AttributeError: 'NoneType' object has no attribute 'is_logged_in'
Environment information
- Python 3.8
- fbchat 1.9.6
I think in _client.py we should change in line 154 return self._state.is_logged_in()
with return bool(self._state)
your code worked fine for me, thanks!