[gnome-software: 5/10] gs-utils: Add missing precondition checks
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 5/10] gs-utils: Add missing precondition checks
- Date: Tue, 22 Feb 2022 12:47:58 +0000 (UTC)
commit 80c0ecfe1f16d067f1a1f608b6cb6ff77e488656
Author: Philip Withnall <pwithnall endlessos org>
Date: Sun Feb 20 13:11:13 2022 +0000
gs-utils: Add missing precondition checks
Signed-off-by: Philip Withnall <pwithnall endlessos org>
lib/gs-utils.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/lib/gs-utils.c b/lib/gs-utils.c
index 1b13e2137..a976c06f7 100644
--- a/lib/gs-utils.c
+++ b/lib/gs-utils.c
@@ -1544,6 +1544,7 @@ gs_utils_get_file_etag (const gchar *filename,
g_autoptr(GFileInfo) info = NULL;
g_return_val_if_fail (filename != NULL, NULL);
+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
file = g_file_new_for_path (filename);
info = g_file_query_info (file, METADATA_ETAG_ATTRIBUTE, G_FILE_QUERY_INFO_NONE, cancellable, NULL);
@@ -1578,6 +1579,7 @@ gs_utils_set_file_etag (const gchar *filename,
g_autoptr(GFile) file = NULL;
g_return_val_if_fail (filename != NULL, FALSE);
+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
file = g_file_new_for_path (filename);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]