Skip to content

Commit

Permalink
Add missing None check in get_attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
juangj committed Aug 12, 2016
1 parent 4b46465 commit 4326cb0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py/selenium/webdriver/remote/webelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ def get_attribute(self, name):
else:
resp = self._execute(Command.GET_ELEMENT_ATTRIBUTE, {'name': name})
attributeValue = resp.get('value')
if name != 'value' and attributeValue.lower() in ('true', 'false'):
attributeValue = attributeValue.lower()
if attributeValue is not None:
if name != 'value' and attributeValue.lower() in ('true', 'false'):
attributeValue = attributeValue.lower()
return attributeValue

def is_selected(self):
Expand Down

0 comments on commit 4326cb0

Please sign in to comment.