mirror of https://github.com/djcb/mu.git
mu-threader: debugging for some reported problem in find_or_create
This commit is contained in:
parent
182974bbc7
commit
99f08c50c4
|
@ -154,17 +154,24 @@ find_or_create_referred (GHashTable *id_table, const char *msgid,
|
||||||
static MuContainer*
|
static MuContainer*
|
||||||
find_or_create (GHashTable *id_table, MuMsg *msg, guint docid)
|
find_or_create (GHashTable *id_table, MuMsg *msg, guint docid)
|
||||||
{
|
{
|
||||||
MuContainer *c;
|
MuContainer *c;
|
||||||
const char* msgid;
|
const char* msgid;
|
||||||
|
char fake[32];
|
||||||
|
|
||||||
g_return_val_if_fail (msg, NULL);
|
g_return_val_if_fail (msg, NULL);
|
||||||
g_return_val_if_fail (docid != 0, NULL);
|
g_return_val_if_fail (docid != 0, NULL);
|
||||||
|
|
||||||
msgid = mu_msg_get_msgid (msg);
|
msgid = mu_msg_get_msgid (msg);
|
||||||
if (!msgid)
|
if (!msgid)
|
||||||
msgid = mu_msg_get_path (msg); /* fake it */
|
msgid = mu_msg_get_path (msg); /* fake it */
|
||||||
|
if (!msgid) { /* no path either? seems to happen... */
|
||||||
c = g_hash_table_lookup (id_table, msgid);
|
g_warning ("message without path");
|
||||||
|
snprintf (fake, sizeof(fake), "fake:%p", (gpointer)msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX the '<none>' works around a crash; find a better
|
||||||
|
* solution */
|
||||||
|
c = g_hash_table_lookup (id_table, msgid ? msgid : fake);
|
||||||
|
|
||||||
/* If id_table contains an empty MuContainer for this ID: * *
|
/* If id_table contains an empty MuContainer for this ID: * *
|
||||||
* Store this message in the MuContainer's message slot. */
|
* Store this message in the MuContainer's message slot. */
|
||||||
|
|
Loading…
Reference in New Issue