ges: Do not clear potentially NULL errors

And avoid dereferencing NULL errors
This commit is contained in:
Thibault Saunier 2015-03-17 18:25:02 +01:00
parent 663824d20f
commit d114cc60bd
2 changed files with 8 additions and 3 deletions

View file

@ -763,7 +763,8 @@ ges_project_create_asset_sync (GESProject * project, const gchar * id,
if (possible_id == NULL)
return NULL;
g_clear_error (error);
if (error)
g_clear_error (error);
id = possible_id;
}

View file

@ -185,12 +185,16 @@ _ges_get_asset_from_timeline (GESTimeline * timeline, GType type,
{
GESAsset *asset;
GESProject *project = ges_timeline_get_project (timeline);
GError *err = NULL;
asset = ges_project_create_asset_sync (project, id, type, error);
asset = ges_project_create_asset_sync (project, id, type, &err);
if (err)
g_propagate_error (error, err);
if (!asset || (error && *error)) {
GST_ERROR
("There was an error requesting the asset with id %s and type %s (%s)",
id, g_type_name (type), (*error) ? (*error)->message : "unknown");
id, g_type_name (type), error ? (*error)->message : "unknown");
return NULL;
}