Python plugin: Account: Harden string representation
authorHolger Berndt <hb@claws-mail.org>
Thu, 8 Aug 2013 21:26:22 +0000 (23:26 +0200)
committerHolger Berndt <hb@claws-mail.org>
Thu, 8 Aug 2013 21:34:37 +0000 (23:34 +0200)
src/plugins/python/accounttype.c

index d50f252..6239ead 100644 (file)
@@ -53,7 +53,9 @@ static int Account_compare(clawsmail_AccountObject *obj1, clawsmail_AccountObjec
 
 static PyObject* Account_str(clawsmail_AccountObject *self)
 {
 
 static PyObject* Account_str(clawsmail_AccountObject *self)
 {
-  return PyString_FromFormat("Account: %s", self->account->account_name);
+  if(self->account && self->account->account_name)
+    return PyString_FromFormat("Account: %s", self->account->account_name);
+  Py_RETURN_NONE;
 }
 
 static PyObject* get_account_name(clawsmail_AccountObject *self, void *closure)
 }
 
 static PyObject* get_account_name(clawsmail_AccountObject *self, void *closure)