diff options
-rw-r--r-- | src/bluetooth/qbluetoothsocket_bluez.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp index 7ff96dd9..b9ed73a6 100644 --- a/src/bluetooth/qbluetoothsocket_bluez.cpp +++ b/src/bluetooth/qbluetoothsocket_bluez.cpp @@ -134,6 +134,12 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address, Q_UNUSED(openMode); int result = -1; + if (socket == -1 && !ensureNativeSocket(socketType)) { + errorString = QObject::tr("Unknown socket error"); + q->setSocketError(QBluetoothSocket::UnknownSocketError); + return; + } + if (socketType == QBluetoothServiceInfo::RfcommProtocol) { sockaddr_rc addr; |