Commit d56f85e1 authored by Boudewijn Rempt's avatar Boudewijn Rempt Committed by Blackbeard (alberto flores)

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 8cf2d1f0
......@@ -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