Commit dbf3fd7a authored by Halla Rempt's avatar Halla Rempt
Browse files

Check whether createNewImage has returned 0

This fixes a crash when pressing cancel when you're trying to
create a RGB8 linear gamma image, which shouldn't be possible.
parent a1684ad8
......@@ -83,7 +83,8 @@ KisImageFromClipboard::~KisImageFromClipboard()
void KisImageFromClipboard::createImage()
KisDocument *doc = createNewImage();
if (!doc) return; // createNewImage can return 0;
KisImageSP image = doc->image();
if (image && image->root() && image->root()->firstChild()) {
KisLayer * layer = qobject_cast<KisLayer*>(image->root()->firstChild().data());
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment