lib/repo-refs: properly return an error value

This tweaks a logic check in order to return a proper error value
when the related condition is not satisfied.
This commit is contained in:
Luca BRUNO 2022-10-26 11:12:37 +00:00
parent 61d22e5db6
commit a118410b85
No known key found for this signature in database
GPG Key ID: A9834A2252078E4E

View File

@ -36,7 +36,8 @@ add_ref_to_set (const char *remote,
GCancellable *cancellable,
GError **error)
{
g_return_val_if_fail (remote == NULL || collection_id == NULL, FALSE);
if (remote != NULL && collection_id != NULL)
return glnx_throw (error, "Cannot process both a remote and a collection ID");
gsize len;
char *contents = glnx_file_get_contents_utf8_at (base_fd, path, &len, cancellable, error);