mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
Don't crash if set_app_info is called before adding metadata
set_mime_type, set_is_private, add_group, set_groups, set_icon, etc all added metadata before using it. If set_app_info was called before any of those it would crash when trying to access the metadata.
This commit is contained in:
parent
dbf9f7a288
commit
dbad8304ff
@ -3234,6 +3234,9 @@ g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!item->metadata)
|
||||||
|
item->metadata = bookmark_metadata_new ();
|
||||||
|
|
||||||
ai = bookmark_item_lookup_app_info (item, name);
|
ai = bookmark_item_lookup_app_info (item, name);
|
||||||
if (!ai)
|
if (!ai)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user