Bug 465512 - Python search layer causes instant crash
Summary: Python search layer causes instant crash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (other bugs)
Version First Reported In: 5.1.5
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-09 17:05 UTC by keyth_qcfx2
Modified: 2023-03-06 11:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description keyth_qcfx2 2023-02-09 17:05:00 UTC
SUMMARY
Searching for a layer name that is not present on the layer stack causes instant crash

STEPS TO REPRODUCE
1. open a new document
2. run the following code ( code searches for non existent layer )

CODE
"""
from krita import *
node_name = "cenas"
ad = Krita.instance().activeDocument()
node_i = ad.nodeByName( node_name )
ad.setActiveNode( node_i )
"""

OBSERVED RESULT
Krita instant crash

EXPECTED RESULT
no Krita crash with a return of None

SOFTWARE/OS VERSIONS
Windows: 10
Qt Version: 5.12.12

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2023-03-06 11:49:38 UTC
Git commit 519fa7dd2b976d52e5aa3d386c2ff172383aa63c by Halla Rempt.
Committed on 06/03/2023 at 11:48.
Pushed by rempt into branch 'master'.

setActiveNode: check Node parameter is not null

M  +5    -0    libs/libkis/Document.cpp

https://invent.kde.org/graphics/krita/commit/519fa7dd2b976d52e5aa3d386c2ff172383aa63c