reftests: Don't crash if no node

If we have no node, don't crash when trying to save the node file.

Instead, write an empty file.
This commit is contained in:
Benjamin Otte 2021-10-21 03:06:56 +02:00
parent b912e84df7
commit 438bf8596e

View File

@ -311,7 +311,10 @@ save_node (GskRenderNode *node,
}
g_test_message ("Storing test result node at %s", filename);
bytes = gsk_render_node_serialize (node);
if (node)
bytes = gsk_render_node_serialize (node);
else
bytes = g_bytes_new ("", 0);
ret = g_file_set_contents (filename,
g_bytes_get_data (bytes, NULL),
g_bytes_get_size (bytes),