Commit a9e5f54a authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Fix crash in GitWidget

==311129==The signal is caused by a READ memory access.
    #0 0x7f2133640ec0 in QSortFilterProxyModel::data(QModelIndex const&, int) const
    #1 0x7f212994f13a in QModelIndex::data(int) const /usr/include/qt/QtCore/qabstractitemmodel.h:460:17
    #2 0x7f2129a1b16e in GitWidget::treeViewContextMenuEvent(QContextMenuEvent*) kate/addons/project/gitwidget.cpp:1119:55
    #3 0x7f2129a18941 in GitWidget::eventFilter(QObject*, QEvent*) kate/addons/project/gitwidget.cpp:887:9
    #4 0x7f21336675e1 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)
    #5 0x7f213424db2b in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    #6 0x7f2134252361 in QApplication::notify(QObject*, QEvent*)
    #7 0x7f2133667977 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
    #8 0x7f21342a2e13  (libQt5Widgets.so.5+0x1cde13)
    #9 0x7f21342a417d  (libQt5Widgets.so.5+0x1cf17d)
    #10 0x7f213424db3b in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    #11 0x7f2133667977 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
    #12 0x7f2133bad08b in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)
    #13 0x7f2133b96964 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
    #14 0x7f212c248aef  (libQt5XcbQpa.so.5+0x63aef)
    #15 0x7f2131553b2a in g_main_context_dispatch
    #16 0x7f21315a9e78  (libglib-2.0.so.0+0xaae78)
    #17 0x7f2131551251 in g_main_context_iteration (libglib-2.0.so.0+0x52251)
    #18 0x7f21336b225b in QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags)
    #19 0x7f213366011b in QEventLoop::exec(QEventLoop::ProcessEventsFlags)
    #20 0x7f213366ac48 in QCoreApplication::exec() (libQt5Core.so.5+0x290c48)
    #21 0x55ff9fc1a200 in main kate/apps/kate/main.cpp:603:12
    #22 0x7f2132ed72cf  (libc.so.6+0x232cf)
    #23 0x7f2132ed7389 in __libc_start_main (/usr/lib/libc.so.6+0x23389)
    #24 0x55ff9fb12fe4 in _start /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115
parent 48dcf871
Pipeline #250745 passed with stage
in 10 minutes and 31 seconds
......@@ -1032,7 +1032,7 @@ void GitWidget::treeViewContextMenuEvent(QContextMenuEvent *e)
}
}
const auto idx = m_treeView->indexAt(e->pos());
const QPersistentModelIndex idx = m_treeView->indexAt(e->pos());
if (!idx.isValid())
return;
auto treeItem = idx.data(GitStatusModel::TreeItemType);
......@@ -1112,7 +1112,7 @@ void GitWidget::treeViewContextMenuEvent(QContextMenuEvent *e)
}
auto act = menu.exec(m_treeView->viewport()->mapToGlobal(e->pos()));
if (!act) {
if (!act || !idx.isValid()) {
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment