QDoc: check if !isNull() before casting prev/next nodes.
authorCasper van Donderen <casper.vandonderen@nokia.com>
Mon, 4 Jun 2012 07:48:05 +0000 (09:48 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 4 Jun 2012 08:06:17 +0000 (10:06 +0200)
Change-Id: Ifac095ef0af0b483fbf53c6a18cf3c3130d37710
Reviewed-by: Martin Smith <martin.smith@nokia.com>
src/tools/qdoc/ditaxmlgenerator.cpp

index 9bb64d4..a9182c2 100644 (file)
@@ -2414,7 +2414,7 @@ void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marke
         if (node->links().contains(Node::PreviousLink)) {
             linkPair = node->links()[Node::PreviousLink];
             linkNode = findNodeForTarget(linkPair.first, node, marker);
-            if (linkNode->type() == Node::Fake) {
+            if (linkNode && linkNode->type() == Node::Fake) {
                 const FakeNode *fakeNode = static_cast<const FakeNode*>(linkNode);
                 linkPair.second = fakeNode->title();
             }
@@ -2423,7 +2423,7 @@ void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marke
         if (node->links().contains(Node::NextLink)) {
             linkPair = node->links()[Node::NextLink];
             linkNode = findNodeForTarget(linkPair.first, node, marker);
-            if (linkNode->type() == Node::Fake) {
+            if (linkNode && linkNode->type() == Node::Fake) {
                 const FakeNode *fakeNode = static_cast<const FakeNode*>(linkNode);
                 linkPair.second = fakeNode->title();
             }
@@ -2432,7 +2432,7 @@ void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marke
         if (node->links().contains(Node::StartLink)) {
             linkPair = node->links()[Node::StartLink];
             linkNode = findNodeForTarget(linkPair.first, node, marker);
-            if (linkNode->type() == Node::Fake) {
+            if (linkNode && linkNode->type() == Node::Fake) {
                 const FakeNode *fakeNode = static_cast<const FakeNode*>(linkNode);
                 linkPair.second = fakeNode->title();
             }