From 99b80a55e3f38ddeea74cbddaeca932c186cc8ad Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 12 Feb 2013 01:09:29 +0100 Subject: [PATCH] Fix Coverity #980682 --- src/customtrackview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 193f5ef9..e4a15b8e 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -5461,13 +5461,15 @@ void CustomTrackView::slotAddClipExtraData(const QString &id, const QString &key void CustomTrackView::slotAddClipMarker(const QString &id, QList newMarkers, QUndoCommand *groupCommand) { - QUndoCommand *subCommand = NULL; + DocClipBase *base = m_document->clipManager()->getClipById(id); + if (!base) return; + QUndoCommand *subCommand = NULL; if (newMarkers.count() > 1 && groupCommand == NULL) { subCommand = new QUndoCommand; subCommand->setText("Add markers"); } for (int i = 0; i < newMarkers.count(); i++) { - CommentedTime oldMarker = m_document->clipManager()->getClipById(id)->markerAt(newMarkers.at(i).time()); + CommentedTime oldMarker = base->markerAt(newMarkers.at(i).time()); if (oldMarker == CommentedTime()) { oldMarker = newMarkers.at(i); oldMarker.setMarkerType(-1); -- 2.39.2