diff --git a/htmlunit/src/java/org/openqa/selenium/htmlunit/HtmlUnitDriver.java b/htmlunit/src/java/org/openqa/selenium/htmlunit/HtmlUnitDriver.java
index <HASH>..<HASH> 100644
--- a/htmlunit/src/java/org/openqa/selenium/htmlunit/HtmlUnitDriver.java
+++ b/htmlunit/src/java/org/openqa/selenium/htmlunit/HtmlUnitDriver.java
@@ -299,7 +299,7 @@ public class HtmlUnitDriver implements WebDriver, SearchContext, JavascriptExecu
 

   public String getWindowHandle() {

     WebWindow window = webClient.getCurrentWindow();

-    if (window.getName() == null) {

+    if (window.getName() == null || "".equals(window.getName())) {

       nameWindow(window);

     }

     return window.getName();
SimonStewart: Fixing issue #<I>. The name of the window handle is always checked to see if it's blank when getting the current handle or all window handles.

r<I>