Index: embed/mozilla/mozilla-embed-persist.cpp
===================================================================
RCS file: /cvs/gnome/epiphany/embed/mozilla/mozilla-embed-persist.cpp,v
retrieving revision 1.36
diff -u -p -U8 -r1.36 mozilla-embed-persist.cpp
--- embed/mozilla/mozilla-embed-persist.cpp	3 May 2004 13:18:49 -0000	1.36
+++ embed/mozilla/mozilla-embed-persist.cpp	3 May 2004 14:14:22 -0000
@@ -223,36 +223,38 @@ impl_save (EphyEmbedPersist *persist)
                 	browser->GetTargetDocument (getter_AddRefs(DOMDocument));
 		}
         	NS_ENSURE_TRUE (DOMDocument, FALSE);
 	}
 
 
 	/* Get the current page descriptor */
 	nsCOMPtr<nsISupports> pageDescriptor;
-	if (flags & EMBED_PERSIST_COPY_PAGE)
+	if (browser)
 	{
 	        browser->GetPageDescriptor(getter_AddRefs(pageDescriptor));
-		NS_ENSURE_TRUE (pageDescriptor, FALSE);
 	}
 
+	NS_ENSURE_TRUE (!(flags & EMBED_PERSIST_COPY_PAGE) || pageDescriptor, FALSE);
+
+
 	if (filename == NULL)
 	{
 		/* Create an header sniffer and do the save */
 		nsCOMPtr<nsIWebBrowserPersist> webPersist =
 			MOZILLA_EMBED_PERSIST (persist)->priv->mPersist;
 		NS_ENSURE_TRUE (webPersist, FALSE);
 
 		EphyHeaderSniffer* sniffer = new EphyHeaderSniffer
 			(webPersist, MOZILLA_EMBED_PERSIST (persist),
 			 tmpFile, inURI, DOMDocument, postData);
 		if (!sniffer) return FALSE;
  
 		webPersist->SetProgressListener(sniffer);
-		rv = webPersist->SaveURI(inURI, nsnull, nsnull, nsnull, nsnull, tmpFile);
+		rv = webPersist->SaveURI(inURI, pageDescriptor, nsnull, nsnull, nsnull, tmpFile);
 		if (NS_FAILED (rv)) return FALSE;
 	}
 	else
 	{
 		/* Filename to save to */
 		nsCOMPtr<nsILocalFile> destFile;
 		NS_NewNativeLocalFile (nsDependentCString(filename),
 				       PR_TRUE, getter_AddRefs(destFile));
