[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kcachegrind] libviews: Fix crash on right click in flat profile without data
From:       Josef Weidendorfer <Josef.Weidendorfer () gmx ! de>
Date:       2016-10-29 21:08:34
Message-ID: E1c0ari-00014U-RK () code ! kde ! org
[Download RAW message or body]

Git commit 446a8170b312e1673f475d11810f4af01c4cc608 by Josef Weidendorfer.
Committed on 29/10/2016 at 21:06.
Pushed by weidendo into branch 'master'.

Fix crash on right click in flat profile without data

Usually profile data is loaded, so this would not trigger.

M  +3    -3    libviews/functionselection.cpp

http://commits.kde.org/kcachegrind/446a8170b312e1673f475d11810f4af01c4cc608

diff --git a/libviews/functionselection.cpp b/libviews/functionselection.cpp
index b0e62d6..fab7a89 100644
--- a/libviews/functionselection.cpp
+++ b/libviews/functionselection.cpp
@@ -351,11 +351,11 @@ void FunctionSelection::addGroupMenu(QMenu* menu)
 	addGroupAction(m,  ProfileContext::Function, tr("No Grouping"));
 	m->addSeparator();
     }
-    if (_data->objectMap().count()>1)
+    if (_data && _data->objectMap().count()>1)
 	addGroupAction(m, ProfileContext::Object);
-    if (_data->fileMap().count()>1)
+    if (_data && _data->fileMap().count()>1)
 	addGroupAction(m, ProfileContext::File);
-    if (_data->classMap().count()>1)
+    if (_data && _data->classMap().count()>1)
 	addGroupAction(m, ProfileContext::Class);
     addGroupAction(m, ProfileContext::FunctionCycle);
=20
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic