From ccf5b5ca471663a3b1e5295575d9a94692f52fb7 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Thu, 9 Jun 2022 20:32:22 +0530 Subject: [PATCH] Add a few asserts to debug GUI client crash The crash seems to happen in the following scenario - * Ostinato and drone are both running (with some devices/streams) * Kill and restart drone * Wait for GUI to reconnect to drone * Click on one of the ports in the port list --- client/portgrouplist.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/portgrouplist.cpp b/client/portgrouplist.cpp index 7ebe5ed..3adf7b1 100644 --- a/client/portgrouplist.cpp +++ b/client/portgrouplist.cpp @@ -68,6 +68,7 @@ bool PortGroupList::isPort(const QModelIndex& index) PortGroup& PortGroupList::portGroup(const QModelIndex& index) { + Q_ASSERT(index.isValid()); Q_ASSERT(mPortGroupListModel.isPortGroup(index)); return *(mPortGroups[index.row()]); @@ -75,6 +76,8 @@ PortGroup& PortGroupList::portGroup(const QModelIndex& index) Port& PortGroupList::port(const QModelIndex& index) { + Q_ASSERT(index.isValid()); + Q_ASSERT(index.parent().isValid()); Q_ASSERT(mPortGroupListModel.isPort(index)); return (*mPortGroups.at(index.parent().row())->mPorts[index.row()]); }