PackageKit: Fix crash on error

Sometimes a "normal" error occurs and then the callback is
called with no context data. Then crash boom sigsegv happens.
This commit is contained in:
Jean-Philippe Andre 2015-04-17 10:30:06 +09:00
parent 45f26f5205
commit b30892056e
1 changed files with 1 additions and 0 deletions

View File

@ -220,6 +220,7 @@ static void
_store_error(E_PackageKit_Module_Context *ctxt, const char *err)
{
ERR("PKGKIT: ERROR: %s", err);
if (!ctxt) return; // see packagekit_get_updates()
if (ctxt->error)
eina_stringshare_replace(&ctxt->error, err);
else