summaryrefslogtreecommitdiffstats
path: root/content/browser/accessibility/browser_accessibility_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/accessibility/browser_accessibility_win.cc')
-rw-r--r--content/browser/accessibility/browser_accessibility_win.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index e98ae71..60728e0 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -739,6 +739,9 @@ STDMETHODIMP BrowserAccessibilityWin::get_windowHandle(HWND* window_handle) {
return E_INVALIDARG;
*window_handle = manager()->ToBrowserAccessibilityManagerWin()->parent_hwnd();
+ if (!*window_handle)
+ return E_FAIL;
+
return S_OK;
}
@@ -992,6 +995,8 @@ STDMETHODIMP BrowserAccessibilityWin::get_imagePosition(
if (coordinate_type == IA2_COORDTYPE_SCREEN_RELATIVE) {
HWND parent_hwnd =
manager()->ToBrowserAccessibilityManagerWin()->parent_hwnd();
+ if (!parent_hwnd)
+ return E_FAIL;
POINT top_left = {0, 0};
::ClientToScreen(parent_hwnd, &top_left);
*x = GetLocation().x() + top_left.x;