libgimpbase: pass a NULL GStrv as an empty GStrv.

NULL is not a proper value for GStrv yet we cannot escape it in the PDB
since we generate default values for non-passed arguments (especially in
interactive case where most procedure arguments aren't set). And for
such boxed type, it will be NULL.

So when we see a NULL GStrv parameter, let's not ignore it (which will
just crash the plug-in). Simply transform it to a GStrv of size 0.
This commit is contained in:
Jehan 2022-02-10 23:53:10 +01:00
parent 1e34a95db7
commit 87916e5069
1 changed files with 17 additions and 13 deletions

View File

@ -1792,9 +1792,13 @@ _gp_params_write (GIOChannel *channel,
break;
case GP_PARAM_TYPE_STRV:
if (params[i].data.d_strv)
{
gint size = g_strv_length (params[i].data.d_strv);
gint size;
if (params[i].data.d_strv)
size = g_strv_length (params[i].data.d_strv);
else
size = 0;
if (! _gimp_wire_write_int32 (channel,
(guint32*) &size, 1,
@ -1804,8 +1808,8 @@ _gp_params_write (GIOChannel *channel,
size,
user_data))
return;
break;
}
break;
case GP_PARAM_TYPE_ID_ARRAY:
if (! _gimp_wire_write_string (channel,