Commit e859c421 authored by Amy spark's avatar Amy spark 👉
Browse files

KisImageFromClipboardWidget: do not attempt to create an image with an empty clipboard

CCBUG:459800
parent 15ec633d
......@@ -64,6 +64,8 @@ KisImageFromClipboardWidget::~KisImageFromClipboardWidget()
void KisImageFromClipboardWidget::createImage()
{
KIS_SAFE_ASSERT_RECOVER_RETURN(KisClipboard::instance()->hasClip());
newDialogConfirmationButtonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
KisDocument *doc = createNewImage();
......@@ -75,10 +77,7 @@ void KisImageFromClipboardWidget::createImage()
KisPaintDeviceSP clip = KisClipboard::instance()->clip(QRect(), true);
if (!clip) {
KisPart::instance()->removeDocument(doc);
return;
}
KIS_ASSERT(clip);
KisImportCatcher::adaptClipToImageColorSpace(clip, image);
......
Supports Markdown
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