From bc179804008c05821bccf52482eeee11ddb7f465 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 5 Jul 2019 10:23:14 +0200 Subject: gui: fix potential process detector crash --- gui/process_detector.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(ui.tableWidget->cellWidget(i, 1))->currentText(); + auto widget = qobject_cast(ui.tableWidget->cellWidget(i, 1)); + if (!widget) + continue; + auto profile = widget->currentText(); str += RECORD_SEPARATOR + exe + UNIT_SEPARATOR + profile; } -- cgit v1.2.3