summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mailnews/addrbook/src/nsAbView.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/mailnews/addrbook/src/nsAbView.cpp b/mailnews/addrbook/src/nsAbView.cpp
index 77f3122df..aed4390de 100644
--- a/mailnews/addrbook/src/nsAbView.cpp
+++ b/mailnews/addrbook/src/nsAbView.cpp
@@ -855,6 +855,9 @@ nsCString getQuery(nsCOMPtr<nsIAbDirectory> aDir)
NS_IMETHODIMP nsAbView::OnItemAdded(nsISupports *parentDir, nsISupports *item)
{
+ if (!mDirectory) // No address book selected.
+ return NS_OK;
+
nsresult rv;
nsCOMPtr <nsIAbDirectory> directory = do_QueryInterface(parentDir, &rv);
NS_ENSURE_SUCCESS(rv,rv);