summaryrefslogtreecommitdiff
path: root/examples/serialport/blockingmaster/masterthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/serialport/blockingmaster/masterthread.cpp')
-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 12d23bb..25aa848 100644
--- a/examples/serialport/blockingmaster/masterthread.cpp
+++ b/examples/serialport/blockingmaster/masterthread.cpp
@@ -104,6 +104,11 @@ void MasterThread::run()
//! [5] //! [6]
QSerialPort serial;
+ if (currentPortName.isEmpty()) {
+ emit error(tr("No port name specified"));
+ return;
+ }
+
while (!m_quit) {
//![6] //! [7]
if (currentPortNameChanged) {