From a367dec2f849b80cb3fea0abeeaed7578aac185b Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Thu, 18 Apr 2024 12:42:30 -0400 Subject: [PATCH] plug-ins: fix #10787 Page Setup warning/critical When closing the Page Setup dialog we had warnings and criticals in the terminal. The cause for this was that we were looking for the temp procedure to notify the print plug-in. However, this temp procedure is only installed if the print plug-in is running, not when running the Page Setup directly, in which case it is not needed. We now check if the procedure is valid (meaning the print plug-in is running) before calling the temp notify procedure. --- plug-ins/print/print.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plug-ins/print/print.c b/plug-ins/print/print.c index 6b6118970c..3d20552775 100644 --- a/plug-ins/print/print.c +++ b/plug-ins/print/print.c @@ -402,9 +402,13 @@ page_setup (GimpImage *image) gimp_plug_in_set_pdb_error_handler (gimp_get_plug_in (), GIMP_PDB_ERROR_HANDLER_PLUGIN); + /* Notify the Print plug-in if Page Setup was called from there */ procedure = gimp_pdb_lookup_procedure (gimp_get_pdb (), name); - return_vals = gimp_procedure_run (procedure, "image", image, NULL); - gimp_value_array_unref (return_vals); + if (procedure) + { + return_vals = gimp_procedure_run (procedure, "image", image, NULL); + gimp_value_array_unref (return_vals); + } g_free (name);