From: Christophe Bourcier Date: Tue, 30 Jul 2019 12:27:15 +0000 (+0200) Subject: Fix sigsegv if right-click in Model data panel and nothing is selected X-Git-Tag: V9_4_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=044d51a9790118fd52e3af84ebdf3f340b44280f;p=modules%2Fhexablock.git Fix sigsegv if right-click in Model data panel and nothing is selected --- diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx index 4c8cbe2..7ff4d47 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx @@ -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;