Check obj is not None for _isChildOf

This commit is contained in:
JonnyWong16 2021-02-06 20:31:07 -08:00
parent a7f5d16aee
commit 04a07b3e7d
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -119,9 +119,9 @@ class PlexObject(object):
See all possible `**kwargs*` in :func:`~plexapi.base.PlexObject.fetchItem`.
"""
obj = self
while obj._parent is not None and obj._parent() is not None:
while obj and obj._parent is not None:
obj = obj._parent()
if obj._checkAttrs(obj._data, **kwargs):
if obj and obj._checkAttrs(obj._data, **kwargs):
return True
return False