FrameSvg: prevent crash when calling mask() with no frame yet created
Reviewers: #plasma, apol Reviewed By: apol Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D21200
This commit is contained in:
parent
084ba0f886
commit
193775def6
@ -298,10 +298,14 @@ QPixmap FrameSvg::alphaMask() const
|
||||
|
||||
QRegion FrameSvg::mask() const
|
||||
{
|
||||
QRegion result;
|
||||
if (!d->frame) {
|
||||
return result;
|
||||
}
|
||||
|
||||
QString id = d->cacheId(d->frame.data(), QString());
|
||||
|
||||
QRegion* obj = d->frame->cachedMasks.object(id);
|
||||
QRegion result;
|
||||
|
||||
if (!obj) {
|
||||
obj = new QRegion(QBitmap(d->alphaMask().mask()));
|
||||
|
Loading…
Reference in New Issue
Block a user