Add some g_return checks to gvdb_table_write_contents()

I'm not auditing all the public functions in this file for precondition
checks, but since I'm adding an async version of this function, it
makes sense to ensure there are matching checks for the sync version.
This commit is contained in:
Michael Catanzaro 2019-06-21 09:58:15 -05:00
parent d12c5aaba8
commit 16fb81cd7e

View File

@ -511,6 +511,10 @@ gvdb_table_write_contents (GHashTable *table,
FileBuilder *fb;
GString *str;
g_return_val_if_fail (table != NULL, FALSE);
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
fb = file_builder_new (byteswap);
file_builder_add_hash (fb, table, &root);
str = file_builder_serialise (fb, root);