From 044d51a9790118fd52e3af84ebdf3f340b44280f Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Tue, 30 Jul 2019 14:27:15 +0200 Subject: [PATCH] Fix sigsegv if right-click in Model data panel and nothing is selected --- src/HEXABLOCKGUI/HEXABLOCKGUI.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.39.2