In general, we're probably going to need to change most of our
`g_return_if_fail` to `g_assert`. The analyzer flags that
the function can return `NULL`, but the caller isn't prepared for
this.
In practice, let's abort.
* ostree_sysroot_get_booted_deployment:
* @self: Sysroot
*
+ * This function may only be called if the sysroot is loaded.
+ *
* Returns: (transfer none) (nullable): The currently booted deployment, or %NULL if none
*/
OstreeDeployment *
ostree_sysroot_get_booted_deployment (OstreeSysroot *self)
{
- g_return_val_if_fail (self->loadstate == OSTREE_SYSROOT_LOAD_STATE_LOADED, NULL);
+ g_assert (self);
+ g_assert (self->loadstate == OSTREE_SYSROOT_LOAD_STATE_LOADED);
return self->booted_deployment;
}
OstreeRepo *
ostree_sysroot_repo (OstreeSysroot *self)
{
- g_return_val_if_fail (self->loadstate >= OSTREE_SYSROOT_LOAD_STATE_LOADED, NULL);
+ g_assert (self);
+ g_assert (self->loadstate >= OSTREE_SYSROOT_LOAD_STATE_LOADED);
g_assert (self->repo);
return self->repo;
}