file-cel: make generating thumbnails more robust

Ran non-interactively, file-cel could crash e.g. if loading an image to
generate a thumbnail, because there is no way to specify a palette file
in that case.
This commit is contained in:
Nils Philippsen 2012-09-06 12:42:48 +02:00
parent 1981cb9a82
commit 96ce2c936d
1 changed files with 4 additions and 1 deletions

View File

@ -186,7 +186,10 @@ run (const gchar *name,
if (run_mode == GIMP_RUN_NONINTERACTIVE)
{
palette_file = param[3].data.d_string;
data_length = strlen (palette_file) + 1;
if (palette_file)
data_length = strlen (palette_file) + 1;
else
data_length = 0;
}
else if (run_mode == GIMP_RUN_INTERACTIVE)
{