summaryrefslogtreecommitdiffstats
path: root/src/serialbus/doc/src/passthrucan.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/serialbus/doc/src/passthrucan.qdoc')
-rw-r--r--src/serialbus/doc/src/passthrucan.qdoc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/serialbus/doc/src/passthrucan.qdoc b/src/serialbus/doc/src/passthrucan.qdoc
index 21e6283..eff2ef7 100644
--- a/src/serialbus/doc/src/passthrucan.qdoc
+++ b/src/serialbus/doc/src/passthrucan.qdoc
@@ -99,9 +99,13 @@
signal:
\code
- connect(device, &QCanBusDevice::stateChanged,
- this, &MyClass::canStateChanged);
- device->connectDevice();
+ if (!device) {
+ // Error handling goes here
+ } else {
+ connect(device, &QCanBusDevice::stateChanged,
+ this, &MyClass::canStateChanged);
+ device->connectDevice();
+ }
\endcode
\l {QCanBusDevice::}{state()} will return \l {QCanBusDevice::}{ConnectedState}