mirror of https://github.com/GNOME/gimp.git
app: gimp_procedure_execute(): don't use a NULL plug-ins error message
return_vals[1] being present and being a string doesn't neccessarily mean it comes from the plug-in, it might just as well be its first return value, which gets generated and NULL-initialized by the plug-in execution code even if the plug-in didn't actually return anything.
This commit is contained in:
parent
cf05b69e1e
commit
60014630fa
|
@ -349,17 +349,17 @@ gimp_procedure_execute (GimpProcedure *procedure,
|
|||
* from the error message that is optionally passed with
|
||||
* the return values.
|
||||
*/
|
||||
if (error && *error == NULL)
|
||||
{
|
||||
if (gimp_value_array_length (return_vals) > 1 &&
|
||||
if (error && *error == NULL &&
|
||||
gimp_value_array_length (return_vals) > 1 &&
|
||||
G_VALUE_HOLDS_STRING (gimp_value_array_index (return_vals, 1)))
|
||||
{
|
||||
GValue *value = gimp_value_array_index (return_vals, 1);
|
||||
const gchar *message = g_value_get_string (value);
|
||||
|
||||
if (message)
|
||||
g_set_error_literal (error, GIMP_PDB_ERROR,
|
||||
GIMP_PDB_ERROR_FAILED,
|
||||
g_value_get_string (value));
|
||||
}
|
||||
message);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue