diff --git a/lib/WebDriver/Window.php b/lib/WebDriver/Window.php index 38efada..bf7e53a 100644 --- a/lib/WebDriver/Window.php +++ b/lib/WebDriver/Window.php @@ -83,9 +83,9 @@ public function __construct($url, $windowHandle = null) public function getHandle() { if (! $this->windowHandle) { - $result = $this->curl('GET', $this->url); + $result = $this->curl('GET', ''); - $this->windowHandle = array_key_exists(self::WEB_WINDOW_ID, $result['value']) + $this->windowHandle = is_array($result['value']) && array_key_exists(self::WEB_WINDOW_ID, $result['value']) ? $result['value'][self::WEB_WINDOW_ID] : $result['value']; }