* mu-store-read: cleanup function a bit
(fruitlessly trying to track down
https://code.google.com/p/mu0/issues/detail?id=80)
This commit is contained in:
@ -131,11 +131,17 @@ char*
|
|||||||
mu_store_get_metadata (const MuStore *store, const char *key, GError **err)
|
mu_store_get_metadata (const MuStore *store, const char *key, GError **err)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (store, NULL);
|
g_return_val_if_fail (store, NULL);
|
||||||
|
g_return_val_if_fail (store->db_read_only(), NULL);
|
||||||
g_return_val_if_fail (key, NULL);
|
g_return_val_if_fail (key, NULL);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const std::string val (store->db_read_only()->get_metadata (key));
|
std::string val;
|
||||||
return val.empty() ? NULL : g_strdup (val.c_str());
|
|
||||||
|
val = store->db_read_only()->get_metadata (key);
|
||||||
|
if (!val.empty())
|
||||||
|
return g_strdup (val.c_str());
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
|
||||||
} MU_XAPIAN_CATCH_BLOCK_G_ERROR_RETURN(err, MU_ERROR_XAPIAN, NULL);
|
} MU_XAPIAN_CATCH_BLOCK_G_ERROR_RETURN(err, MU_ERROR_XAPIAN, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user