From: Mikko Rapeli Date: Fri, 10 Aug 2012 12:17:13 +0000 (+0200) Subject: projectlistview.cpp: check for null pointer X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=12a5d89680803b84dc83a52f7eb8805cccb865a8;p=kdenlive projectlistview.cpp: check for null pointer Fixes Coverity CID 709291: Explicit null dereferenced (FORWARD_NULL) Passing null variable "item" to function "FolderProjectItem::groupName() const", which dereferences it. [show details] 272 props.insert("groupname", item->groupName()); ... Assigning: "item" = 0. 276 } else item = NULL; --- diff --git a/src/projectlistview.cpp b/src/projectlistview.cpp index f5b8a888..e4a2641b 100644 --- a/src/projectlistview.cpp +++ b/src/projectlistview.cpp @@ -266,7 +266,7 @@ void ProjectListView::dropEvent(QDropEvent *event) if (it->type() == PROJECTCLIPTYPE) { if (it->parent()) clone = (ProjectItem*) it->parent()->takeChild(it->parent()->indexOfChild(it)); else clone = (ProjectItem*) takeTopLevelItem(indexOfTopLevelItem(it)); - if (clone) { + if (clone && item) { item->addChild(clone); QMap props; props.insert("groupname", item->groupName());