From 4f6fef6d82dac59e1dcff7783ee1fa46cdaa34c5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 11 Jan 2019 19:05:45 -0500 Subject: [PATCH] Don't return NULL without setting an error Set the expected error when returning NULL from flatpak_dir_get_config due to an empty repo. Closes: #2576 Closes: #2577 Approved by: mwleeds --- common/flatpak-dir.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index f6563c23..5a905c3e 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -2676,7 +2676,11 @@ flatpak_dir_get_config (FlatpakDir *self, return NULL; if (self->repo == NULL) - return NULL; + { + g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND, + _("The config key %s is not set"), key); + return NULL; + } config = ostree_repo_get_config (self->repo); ostree_key = g_strconcat ("xa.", key, NULL);