Bug 474673

Summary: Pasting Transform Mask with shortcut crashes
Product: [Applications] krita Reporter: Freya Lupen <penguinflyer2222>
Component: Layer StackAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: crash CC: dimula73
Priority: NOR Keywords: release_blocker
Version: 5.2.0-rc1   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Freya Lupen 2023-09-18 23:10:02 UTC
SUMMARY
As reported on KA, using the keyboard shortcut to paste a Transform Mask crashes Krita.
(Using the menu command works fine.)

This is a regression of caaa5bc5 (https://invent.kde.org/graphics/krita/-/commit/caaa5bc5645fc547dfa2e457808c3ab94918d55e).

STEPS TO REPRODUCE
1. Create a Transform Mask.
2. Copy it via shortcut or menu.
3. Use the keyboard shortcut to paste it (Ctrl+V).

OBSERVED RESULT
Instant crash.

EXPECTED RESULT
Pasted mask.

SOFTWARE/OS VERSIONS
Krita 5.2.0-rc1

ADDITIONAL INFORMATION
Backtrace snippet:
> 5   libkritaglobal.20.0.0.dylib   	       0x1014e9ee4 kis_assert_common(char const*, char const*, int, bool, bool) + 1376 (kis_assert.cpp:90)
> 6   libkritaui.20.0.0.dylib       	       0x101b26e84 KisPasteActionFactory::run(bool, KisViewManager*)::$_0::operator()() const + 68 (KisPasteActionFactories.cpp:226) [inlined]
> 7   libkritaui.20.0.0.dylib       	       0x101b26e84 KisPasteActionFactory::run(bool, KisViewManager*) + 1144 (KisPasteActionFactories.cpp:221)
> 8   libkritaui.20.0.0.dylib       	       0x101945044 KisSelectionManager::paste() + 44 (kis_selection_manager.cc:359)
Comment 1 Dmitry Kazakov 2023-09-20 09:14:47 UTC
Git commit 44a08aa379ae5796df1d7371960c5501f3d3792a by Dmitry Kazakov.
Committed on 20/09/2023 at 11:11.
Pushed by dkazakov into branch 'krita/5.2'.

Fix crash when copy-pasting a transformation mask

M  +6    -1    libs/ui/actions/KisPasteActionFactories.cpp

https://invent.kde.org/graphics/krita/-/commit/44a08aa379ae5796df1d7371960c5501f3d3792a
Comment 2 Dmitry Kazakov 2023-09-20 09:15:14 UTC
Git commit 7c2af632871a1b258f909c4c1fa0de4a0f4bfc82 by Dmitry Kazakov.
Committed on 20/09/2023 at 11:15.
Pushed by dkazakov into branch 'master'.

Fix crash when copy-pasting a transformation mask

M  +6    -1    libs/ui/actions/KisPasteActionFactories.cpp

https://invent.kde.org/graphics/krita/-/commit/7c2af632871a1b258f909c4c1fa0de4a0f4bfc82