Qt XML Patterns File System Example: Do not bind to a null node index
[profile/ivi/qtxmlpatterns.git] / examples / xmlpatterns / filetree / mainwindow.cpp
index 83c3ebf..3116305 100644 (file)
@@ -94,7 +94,7 @@ void MainWindow::on_queryBox_currentIndexChanged()
 //! [3]
 void MainWindow::evaluateResult()
 {
-    if (queryBox->currentText().isEmpty())
+    if (queryBox->currentText().isEmpty() || m_fileNode.isNull())
         return;
 
     QXmlQuery query(m_namePool);