]> SALOME platform Git repositories - modules/hexablock.git/commitdiff
Salome HOME
Fix sigsegv if right-click in Model data panel and nothing is selected
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 30 Jul 2019 12:27:15 +0000 (14:27 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 30 Jul 2019 12:27:15 +0000 (14:27 +0200)
src/HEXABLOCKGUI/HEXABLOCKGUI.cxx

index 4c8cbe262e75993633f32e6ef409d91b1a3d5a18..7ff4d47033b18eaa162866b8d3d44b7e154e5f4c 100644 (file)
@@ -854,6 +854,11 @@ void HEXABLOCKGUI::preferencesChanged( const QString& sect, const QString& name
 void HEXABLOCKGUI::treeContextMenu(const QPoint& aPosition)
 {
     QModelIndex currentIndex = _patternDataTreeView->currentIndex();
+
+    // if nothing is selected, return
+    if (! currentIndex.isValid())
+      return;
+
     QVariant currentAssocVariant;
     QString currentAssocEntry;