mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-19 22:50:35 +03:00
show: Print an error message if commit doesn't have detached metadata
...instead of segfaulting.
This commit is contained in:
parent
7959ad9eaf
commit
edcfcd21a3
@ -124,6 +124,12 @@ do_print_metadata_key (OstreeRepo *repo,
|
||||
if (!ostree_repo_read_commit_detached_metadata (repo, resolved_rev, &metadata,
|
||||
NULL, error))
|
||||
goto out;
|
||||
if (metadata == NULL)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
|
||||
"No detached metadata for commit %s", resolved_rev);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_variant_lookup (metadata, key, "&s", &value))
|
||||
|
Loading…
x
Reference in New Issue
Block a user