Merge pull request #2576 from cgwalters/archive-handle-null-link

This commit is contained in:
Jonathan Lebon 2022-04-04 14:32:52 -04:00 committed by GitHub
commit 59c6934e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,8 +146,12 @@ file_info_from_archive_entry (struct archive_entry *entry)
g_autoptr(GFileInfo) info = _ostree_stbuf_to_gfileinfo (&stbuf);
if (S_ISLNK (stbuf.st_mode))
g_file_info_set_attribute_byte_string (info, "standard::symlink-target",
archive_entry_symlink (entry));
{
const char *target = archive_entry_symlink (entry);
if (target != NULL)
g_file_info_set_attribute_byte_string (info, "standard::symlink-target",
target);
}
return g_steal_pointer (&info);
}