Commit d32d6026 authored by Qiuhao Li's avatar Qiuhao Li Committed by Ignacio Casal Quinteiro

tools: check whether converter->surface is NULL

Fixes #3
parent 6bf9be28
......@@ -210,6 +210,8 @@ static void
gxps_converter_print_converter_end_document (GXPSConverter *converter)
{
GXPSPrintConverter *print_converter = GXPS_PRINT_CONVERTER (converter);
if (converter->surface) {
cairo_status_t status;
cairo_surface_finish (converter->surface);
......@@ -218,6 +220,7 @@ gxps_converter_print_converter_end_document (GXPSConverter *converter)
g_printerr ("Cairo error: %s\n", cairo_status_to_string (status));
cairo_surface_destroy (converter->surface);
converter->surface = NULL;
}
g_free (print_converter->filename);
print_converter->filename = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment