forked from qt-creator/qt-creator
QmlDesigner: Fix crash
There is no guarantee that the timeline is valid at this point. Change-Id: I48a31b1f4c305c4764d8bebee9de16e51aec4a47 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -174,11 +174,13 @@ void TimelineGraphicsScene::invalidateLayout()
|
|||||||
|
|
||||||
void TimelineGraphicsScene::updateKeyframePositionsCache()
|
void TimelineGraphicsScene::updateKeyframePositionsCache()
|
||||||
{
|
{
|
||||||
auto kfPos = keyframePositions();
|
if (currentTimeline().isValid()) {
|
||||||
std::sort(kfPos.begin(), kfPos.end());
|
auto kfPos = keyframePositions();
|
||||||
kfPos.erase(std::unique(kfPos.begin(), kfPos.end()), kfPos.end()); // remove duplicates
|
std::sort(kfPos.begin(), kfPos.end());
|
||||||
|
kfPos.erase(std::unique(kfPos.begin(), kfPos.end()), kfPos.end()); // remove duplicates
|
||||||
|
|
||||||
m_keyframePositionsCache = kfPos;
|
m_keyframePositionsCache = kfPos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// snap a frame to nearest keyframe or ruler tick
|
// snap a frame to nearest keyframe or ruler tick
|
||||||
|
Reference in New Issue
Block a user