summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/serialport/blockingmaster/masterthread.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/serialport/blockingmaster/masterthread.cpp b/examples/serialport/blockingmaster/masterthread.cpp
index c81c819..5ad93fd 100644
--- a/examples/serialport/blockingmaster/masterthread.cpp
+++ b/examples/serialport/blockingmaster/masterthread.cpp
@@ -107,6 +107,11 @@ void MasterThread::run()
//! [5] //! [6]
QSerialPort serial;
+ if (currentPortName.isEmpty()) {
+ emit error(tr("No port name specified"));
+ return;
+ }
+
while (!quit) {
//![6] //! [7]
if (currentPortNameChanged) {