Skip to content

Commit

Permalink
Adding HRESULT check in IE driver
Browse files Browse the repository at this point in the history
Fix for archived issue 7281 (SeleniumHQ/selenium-google-code-issue-archive#7281), basically an HRESULT is not getting checked.

Signed-off-by: Jim Evans <[email protected]>
  • Loading branch information
larsiver authored and jimevans committed Mar 23, 2018
1 parent 977b17d commit 8e7cc40
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cpp/iedriver/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,11 +1016,13 @@ bool Element::GetClickableViewPortLocation(const bool document_contains_frames,
CComPtr<IHTMLDocument2> doc;
this->GetContainingDocument(false, &doc);
int document_mode = DocumentHost::GetDocumentMode(doc);
CComPtr<IHTMLDocument3> document_element_doc;
CComPtr<IHTMLDocument3> document_element_doc;
CComPtr<IHTMLElement> document_element;
HRESULT hr = doc->QueryInterface<IHTMLDocument3>(&document_element_doc);
if (SUCCEEDED(hr) && document_element_doc && document_mode > 5) {
CComPtr<IHTMLElement> document_element;
if (SUCCEEDED(hr) && document_element_doc) {
hr = document_element_doc->get_documentElement(&document_element);
}
if (SUCCEEDED(hr) && document_mode > 5 && document_element) {
CComPtr<IHTMLElement2> size_element;
hr = document_element->QueryInterface<IHTMLElement2>(&size_element);
size_element->get_clientHeight(&window_height);
Expand Down

0 comments on commit 8e7cc40

Please sign in to comment.