Timeline: Don't accidentally add nullptr timeline models

Change-Id: I7ecce618c83a67742a9d57b967dbfbbccd05310e
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-05-31 14:48:24 +02:00
parent d527cc8d5a
commit 661c2407af

View File

@@ -135,7 +135,7 @@ int TimelineNotesModel::get(int modelId, int timelineIndex) const
int TimelineNotesModel::add(int modelId, int timelineIndex, const QString &text)
{
Q_D(TimelineNotesModel);
const TimelineModel *model = d->timelineModels[modelId];
const TimelineModel *model = d->timelineModels.value(modelId);
int typeId = model->typeId(timelineIndex);
TimelineNotesModelPrivate::Note note = { text, modelId, timelineIndex };
d->data << note;