summaryrefslogtreecommitdiffstats
path: root/examples/nfc/ndefeditor/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nfc/ndefeditor/mainwindow.cpp')
-rw-r--r--examples/nfc/ndefeditor/mainwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/nfc/ndefeditor/mainwindow.cpp b/examples/nfc/ndefeditor/mainwindow.cpp
index 527ff6c7..fa0fa91f 100644
--- a/examples/nfc/ndefeditor/mainwindow.cpp
+++ b/examples/nfc/ndefeditor/mainwindow.cpp
@@ -235,6 +235,8 @@ void MainWindow::targetDetected(QNearFieldTarget *target)
this, SLOT(targetError(QNearFieldTarget::Error,QNearFieldTarget::RequestId)));
m_request = target->readNdefMessages();
+ if (!m_request.isValid()) // cannot read messages
+ targetError(QNearFieldTarget::NdefReadError, m_request);
break;
case WriteNdef:
connect(target, SIGNAL(ndefMessagesWritten()), this, SLOT(ndefMessageWritten()));
@@ -242,6 +244,8 @@ void MainWindow::targetDetected(QNearFieldTarget *target)
this, SLOT(targetError(QNearFieldTarget::Error,QNearFieldTarget::RequestId)));
m_request = target->writeNdefMessages(QList<QNdefMessage>() << ndefMessage());
+ if (!m_request.isValid()) // cannot write messages
+ targetError(QNearFieldTarget::NdefWriteError, m_request);
break;
}
}