Skip to content

Commit 4326cb0

Browse files
committed
Add missing None check in get_attribute.
1 parent 4b46465 commit 4326cb0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

py/selenium/webdriver/remote/webelement.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ def get_attribute(self, name):
159159
else:
160160
resp = self._execute(Command.GET_ELEMENT_ATTRIBUTE, {'name': name})
161161
attributeValue = resp.get('value')
162-
if name != 'value' and attributeValue.lower() in ('true', 'false'):
163-
attributeValue = attributeValue.lower()
162+
if attributeValue is not None:
163+
if name != 'value' and attributeValue.lower() in ('true', 'false'):
164+
attributeValue = attributeValue.lower()
164165
return attributeValue
165166

166167
def is_selected(self):

0 commit comments

Comments
 (0)