From 9328bf79f49294e14c1753c9ee17ddd2985c1969 Mon Sep 17 00:00:00 2001 From: drw Date: Fri, 20 Dec 2002 02:17:55 +0000 Subject: Fix to prevent segfault when no process/module is selected in list. --- diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp index 8b58fe9..29cce90 100644 --- a/noncore/settings/sysinfo/modulesinfo.cpp +++ b/noncore/settings/sysinfo/modulesinfo.cpp @@ -122,6 +122,11 @@ void ModulesInfo::updateData() void ModulesInfo::slotSendClicked() { + if ( !ModulesView->currentItem() ) + { + return; + } + QString capstr = tr( "You really want to execute\n" ); capstr.append( CommandCB->currentText() ); capstr.append( "\nfor this module?" ); diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp index 35d7ba1..9a5446a 100644 --- a/noncore/settings/sysinfo/processinfo.cpp +++ b/noncore/settings/sysinfo/processinfo.cpp @@ -144,11 +144,16 @@ void ProcessInfo::updateData() void ProcessInfo::slotSendClicked() { + QListViewItem *currprocess = ProcessView->currentItem(); + if ( !currprocess ) + { + return; + } + QString capstr = tr( "You really want to send\n" ); capstr.append( SignalCB->currentText() ); capstr.append( "\nto this process?" ); - QListViewItem *currprocess = ProcessView->currentItem(); if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ) -- cgit v0.9.0.2