lib/repo: do no return a NULL on failure

This turns an existing check into an assert. The previously returned
NULL may result in confusing callers, as none of them is checking for
that.
This commit is contained in:
Luca BRUNO 2021-12-07 16:20:49 +00:00
parent 4a0ebe507f
commit 58bdfb90c9
No known key found for this signature in database
GPG Key ID: A9834A2252078E4E
1 changed files with 4 additions and 2 deletions

View File

@ -1599,7 +1599,8 @@ _ostree_repo_update_mtime (OstreeRepo *self,
GKeyFile * GKeyFile *
ostree_repo_get_config (OstreeRepo *self) ostree_repo_get_config (OstreeRepo *self)
{ {
g_return_val_if_fail (self->inited, NULL); g_assert (self != NULL);
g_assert (self->inited);
return self->config; return self->config;
} }
@ -1617,7 +1618,8 @@ ostree_repo_copy_config (OstreeRepo *self)
char *data; char *data;
gsize len; gsize len;
g_return_val_if_fail (self->inited, NULL); g_assert (self != NULL);
g_assert (self->inited);
copy = g_key_file_new (); copy = g_key_file_new ();
data = g_key_file_to_data (self->config, &len, NULL); data = g_key_file_to_data (self->config, &len, NULL);