Fix for images without metadata crashing

This commit is contained in:
Sergey Sharybin 2019-02-07 09:33:43 +01:00
parent d6c0f3796a
commit 9b86c90193
1 changed files with 3 additions and 0 deletions

View File

@ -105,6 +105,9 @@ void IMB_metadata_set_field(struct IDProperty *metadata, const char *key, const
void IMB_metadata_foreach(struct ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata)
{
if (ibuf->metadata == NULL) {
return;
}
for (IDProperty *prop = ibuf->metadata->data.group.first; prop != NULL; prop = prop->next) {
callback(prop->name, IDP_String(prop), userdata);
}