Fix #10511 ScriptFu CRITICAL on scripts with no dialog, e.g. Reverse Layers

Magic number 1 changed to 2 in one place. Missed in earlier fix for #10127.

Changed magic number to a defined macro constant so it might not happen again,
should GimpConfig change again.
This commit is contained in:
bootchk
2023-12-22 09:33:18 -05:00
parent 60f8e47176
commit 11b7e4cded
3 changed files with 13 additions and 8 deletions

View File

@ -175,11 +175,8 @@ script_fu_run_procedure (GimpProcedure *procedure,
}
case GIMP_RUN_NONINTERACTIVE:
/* Verify actual args count equals declared arg count.
* Scripts declare args except run_mode (SF hides it.)
* pspecs have run_mode and one extra internal pspec, thus +2.
*/
if (n_pspecs != script->n_args + n_aux_args + 2)
/* Verify actual args count equals declared arg count. */
if (n_pspecs != script->n_args + n_aux_args + SF_ARG_TO_CONFIG_OFFSET)
status = GIMP_PDB_CALLING_ERROR;
if (status == GIMP_PDB_SUCCESS)