Issue #9742: Fix crash when filling new image with Middle Gray color
This patch attempts to resolve #9742 (closed).
The new Middle Gray fill option can be selected for new images and new layers. It works fine for new layers, but it crashed for new images. This is because it tries to retrieve the image from context, and new images are not yet added to the context when the fill command is called.
From the issue comments:
Calling
gimp_context_set_image ()
ingimp_image_new_from_template ()
beforegimp_drawable_fill ()
appears to fix the problem, but I'm not sure if it's the right solution.