Deal with null (but defined) localStorage and sessionStorage objects.

http://gwt-code-reviews.appspot.com/1615807

Author: Jason Terk


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10820 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/storage/client/Storage.java b/user/src/com/google/gwt/storage/client/Storage.java
index 809f20a..df0abce 100644
--- a/user/src/com/google/gwt/storage/client/Storage.java
+++ b/user/src/com/google/gwt/storage/client/Storage.java
@@ -81,11 +81,15 @@
     }
 
     private native boolean detectLocalStorageSupport() /*-{
-      return typeof $wnd.localStorage != "undefined";
+      // This was changed from "typeof $wnd.localStorage != "undefined";" to
+      // support the case when localStorage is disabled.
+      return $wnd.localStorage != null;
     }-*/;
 
     private native boolean detectSessionStorageSupport() /*-{
-      return typeof $wnd.sessionStorage != "undefined";
+      // This was changed from "typeof $wnd.sessionStorage != "undefined";" to
+      // support the case when sessionStorage is disabled.
+      return $wnd.sessionStorage != null;
     }-*/;
   }