Skip to content

Commit

Permalink
Fixing crash encountered when taking screenshot of non-HTML page.
Browse files Browse the repository at this point in the history
This intentionally does not throw an error, but fails silently, with
no screenshot being generated. Fixes issue SeleniumHQ#6576.
  • Loading branch information
jimevans committed Nov 15, 2013
1 parent d5fbbd4 commit e46a294
Show file tree
Hide file tree
Showing 6 changed files with 6,898 additions and 6,938 deletions.
4 changes: 4 additions & 0 deletions cpp/iedriver/CommandHandlers/ScreenshotCommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ class ScreenshotCommandHandler : public IECommandHandler {

CComPtr<IHTMLDocument2> document;
browser->GetDocument(&document);
if (!document) {
LOG(WARN) << "Unable to get document from browser. Are you viewing a non-HTML document?";
return E_ABORT;
}

LocationInfo document_info;
bool result = DocumentHost::GetDocumentDimensions(document, &document_info);
Expand Down
13,825 changes: 6,887 additions & 6,938 deletions cpp/iedriver/Generated/atoms.h

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions cpp/iedriverserver/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ available via the project downloads page. Changes in "revision" field indicate
private releases checked into the prebuilts directory of the source tree, but
not made generally available on the downloads page.

v2.37.0.4
=========
* Updates to JavaScript automation atoms.
* Fixed crash encountered when taking screenshot of non-HTML page. This does
not throw an error, but fails silently, with no screenshot being generated.
Fixes issue #6576.

v2.37.0.3
=========
* Refactored detection of single-text-node child elements in IE. In IE, a
Expand Down
Binary file modified cpp/iedriverserver/IEDriverServer.rc
Binary file not shown.
Binary file modified cpp/prebuilt/Win32/Release/IEDriverServer.exe
Binary file not shown.
Binary file modified cpp/prebuilt/x64/Release/IEDriverServer.exe
Binary file not shown.

0 comments on commit e46a294

Please sign in to comment.