Commit 095b5ca9 authored by Julius Künzel's avatar Julius Künzel

Subtitles: fix crash on "select clip" shortcut

Fixes #941
parent d1e71017
......@@ -287,8 +287,13 @@ int TimelineController::selectedTrack() const
void TimelineController::selectCurrentItem(ObjectType type, bool select, bool addToCurrent)
{
int currentClip = type == ObjectType::TimelineClip ? m_model->getClipByPosition(m_activeTrack, pCore->getTimelinePosition())
: m_model->getCompositionByPosition(m_activeTrack, pCore->getTimelinePosition());
int currentClip = -1;
if (type == ObjectType::TimelineClip) {
currentClip = m_activeTrack == -2 ? m_model->getSubtitleByPosition(pCore->getTimelinePosition()) : m_model->getClipByPosition(m_activeTrack, pCore->getTimelinePosition());
} else {
currentClip = m_model->getCompositionByPosition(m_activeTrack, pCore->getTimelinePosition());
}
if (currentClip == -1) {
pCore->displayMessage(i18n("No item under timeline cursor in active track"), InformationMessage, 500);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment