diff --git a/src/parse-util.c b/src/parse-util.c index 184b597d5d936a9a3e14b1763759922d18981b2c..b8af45796dbd46e4ad4da42f500e62303d484d6b 100644 --- a/src/parse-util.c +++ b/src/parse-util.c @@ -86,7 +86,8 @@ cellref_name (CellRef const *cell_ref, ParsePos const *pp, gboolean no_sheetname /* If it is a non-local reference, add the path to the external sheet */ if (sheet != NULL && !no_sheetname) { - if (sheet->workbook == pp->wb) + /* pp->wb==NULL happens for the leak printer. */ + if (pp->wb == NULL || sheet->workbook == pp->wb) return g_strconcat (sheet->name_quoted, "!", buffer, NULL); return g_strconcat ("[", sheet->workbook->filename, "]", sheet->name_quoted, "!", buffer, NULL);