Fixing bugs in checking uninstalled certificate
diff --git a/src/contactpanel.cpp b/src/contactpanel.cpp
index e978738..adcb32d 100644
--- a/src/contactpanel.cpp
+++ b/src/contactpanel.cpp
@@ -70,12 +70,16 @@
   setKeychain();
 
   m_defaultIdentity = m_keychain->getDefaultIdentity();
-  m_contactManager->setDefaultIdentity(m_defaultIdentity);
-  m_nickName = m_defaultIdentity.get(-1).toUri();
-  m_settingDialog->setIdentity(m_defaultIdentity.toUri(), m_nickName);
+  if(m_defaultIdentity.size() == 0)
+    showError(QString::fromStdString("certificate of ") + QString::fromStdString(m_defaultIdentity.toUri()) + " is missing!\nHave you installed the certificate?");
   Name defaultCertName = m_keychain->getIdentityManager()->getDefaultCertificateNameByIdentity(m_defaultIdentity);
   if(defaultCertName.size() == 0)
     showError(QString::fromStdString("certificate of ") + QString::fromStdString(m_defaultIdentity.toUri()) + " is missing!\nHave you installed the certificate?");
+
+
+  m_contactManager->setDefaultIdentity(m_defaultIdentity);
+  m_nickName = m_defaultIdentity.get(-1).toUri();
+  m_settingDialog->setIdentity(m_defaultIdentity.toUri(), m_nickName);
   
 
   m_profileEditor = new ProfileEditor(m_contactManager);