summaryrefslogtreecommitdiffhomepage
path: root/gui/process_detector.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-07-05 10:23:14 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-07-05 10:24:19 +0200
commitbc179804008c05821bccf52482eeee11ddb7f465 (patch)
treebc84cd304200112bcfadbef9c35357862a4f895d /gui/process_detector.cpp
parent82c10d493e93b98a3b9878d3e008e3d6be9459ef (diff)
gui: fix potential process detector crash
Diffstat (limited to 'gui/process_detector.cpp')
-rw-r--r--gui/process_detector.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gui/process_detector.cpp b/gui/process_detector.cpp
index c49afcb1..332801cc 100644
--- a/gui/process_detector.cpp
+++ b/gui/process_detector.cpp
@@ -151,7 +151,10 @@ void process_detector::save()
for (int i = 0; i < ui.tableWidget->rowCount(); i++)
{
auto exe = ui.tableWidget->item(i, 0)->text();
- auto profile = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(i, 1))->currentText();
+ auto widget = qobject_cast<QComboBox*>(ui.tableWidget->cellWidget(i, 1));
+ if (!widget)
+ continue;
+ auto profile = widget->currentText();
str += RECORD_SEPARATOR + exe + UNIT_SEPARATOR + profile;
}