render-node-tool: Actually load files properly

This commit is contained in:
Benjamin Otte 2023-09-13 20:35:02 +02:00
parent 41af8ee2e2
commit 24048dce43

View File

@ -61,17 +61,15 @@ load_node_file (const char *filename)
GError *error = NULL;
file = g_file_new_for_commandline_arg (filename);
bytes = g_file_load_bytes (file, NULL, NULL, NULL);
bytes = g_file_load_bytes (file, NULL, NULL, &error);
g_object_unref (file);
if (bytes == NULL)
return NULL;
if (!g_utf8_validate (g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes), NULL))
{
g_bytes_unref (bytes);
return NULL;
g_printerr (_("Failed to load node file: %s\n"), error->message);
g_clear_error (&error);
exit (1);
}
return gsk_render_node_deserialize (bytes, deserialize_error_func, &error);
return gsk_render_node_deserialize (bytes, deserialize_error_func, NULL);
}