Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Krita
Commits
e0f66e49
Commit
e0f66e49
authored
Oct 27, 2022
by
Amy spark
👉
Browse files
KisImageFromClipboardWidget: do not attempt to create an image with an empty clipboard
CCBUG:459800
(cherry picked from commit
e859c421
)
parent
a839b21f
Changes
1
Hide whitespace changes
Inline
Side-by-side
libs/ui/widgets/kis_image_from_clipboard_widget.cpp
View file @
e0f66e49
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment