--- \classpath-cvs\classpath\java\net\URL.java	Fri Nov 22 09:58:59 2002
+++ URL.java	Fri Nov 22 16:20:59 2002
@@ -241,13 +241,13 @@
   if (factory != null)
     {
       ph = factory.createURLStreamHandler(protocol);
-      if (ph == null)
-        return null;
-
-      if (cache_handlers)
-        ph_cache.put(protocol, ph.getClass());
+      if (ph != null)
+        {
+          if (cache_handlers)
+            ph_cache.put(protocol, ph.getClass());
 
-      return(ph);
+          return(ph);
+        }
     }
 
   // Finally loop through our search path looking for a match
@@ -659,7 +659,7 @@
    */
   public String getUserInfo ()
   {
-    int at = host.indexOf('@');
+    int at = (host == null) ? -1 : host.indexOf('@');
     return at < 0 ? null : host.substring(0, at);
   }
 
