diff --git a/src/libotutil/ot-keyfile-utils.c b/src/libotutil/ot-keyfile-utils.c index 86a06a9e16..9bba2270b6 100644 --- a/src/libotutil/ot-keyfile-utils.c +++ b/src/libotutil/ot-keyfile-utils.c @@ -46,7 +46,8 @@ ot_keyfile_get_boolean_with_default (GKeyFile *keyfile, ret_bool = g_key_file_get_boolean (keyfile, section, value, &temp_error); if (temp_error) { - if (g_error_matches (temp_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) + if (g_error_matches (temp_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND) + || g_error_matches (temp_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { g_clear_error (&temp_error); ret_bool = default_value; @@ -83,7 +84,8 @@ ot_keyfile_get_value_with_default (GKeyFile *keyfile, ret_value = g_key_file_get_value (keyfile, section, value, &temp_error); if (temp_error) { - if (g_error_matches (temp_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) + if (g_error_matches (temp_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND) + || g_error_matches (temp_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { g_clear_error (&temp_error); ret_value = g_strdup (default_value);