summaryrefslogtreecommitdiff
path: root/toolkit/components/places/nsNavHistory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/places/nsNavHistory.cpp')
-rw-r--r--toolkit/components/places/nsNavHistory.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp
index 8cf3a2e324..7f4007c1ab 100644
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -949,6 +949,10 @@ nsresult // static
nsNavHistory::AsciiHostNameFromHostString(const nsACString& aHostName,
nsACString& aAscii)
{
+ aAscii.Truncate();
+ if (aHostName.IsEmpty()) {
+ return NS_OK;
+ }
// To properly generate a uri we must provide a protocol.
nsAutoCString fakeURL("http://");
fakeURL.Append(aHostName);