diff options
author | Benjamin Otte <otte@redhat.com> | 2023-03-29 02:28:01 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-03-31 20:26:19 -0400 |
commit | f00b29f2c6b46ff13946f4668907c85669f531c3 (patch) | |
tree | 3255ebf68b01c5c71541711801b23e9bdb4613da | |
parent | 5c20cb08dc8beb52f5e2e2a54bdd26e56fbd870b (diff) | |
download | gtk+-cherry-picks-for-4-10.tar.gz |
rendernodeparser: Emit error when failing to resolve URLcherry-picks-for-4-10
-rw-r--r-- | gsk/gskrendernodeparser.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c index e377e82d8b..ea2dca1e5b 100644 --- a/gsk/gskrendernodeparser.c +++ b/gsk/gskrendernodeparser.c @@ -128,6 +128,10 @@ parse_texture (GtkCssParser *parser, } else { + g_set_error (&error, + GTK_CSS_PARSER_ERROR, + GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE, + "Failed to resolve URL"); texture = NULL; } } @@ -229,8 +233,19 @@ parse_script (GtkCssParser *parser, GFile *file; file = gtk_css_parser_resolve_url (parser, url); - bytes = g_file_load_bytes (file, NULL, NULL, &error); - g_object_unref (file); + if (file) + { + bytes = g_file_load_bytes (file, NULL, NULL, &error); + g_object_unref (file); + } + else + { + g_set_error (&error, + GTK_CSS_PARSER_ERROR, + GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE, + "Failed to resolve URL"); + bytes = NULL; + } } g_free (scheme); |