This is a blind attempt to fix QTBUG-26615. I can't
reproduce the crash on OSX.
Task nr: QTBUG-26615
Change-Id: Ifc6b68b7f302b9cd7d02129be8ae56841a35e5de
Reviewed-by: Martin Smith <martin.smith@nokia.com>
int numBestTargets = 0;
QList<Target> bestTargetList;
+ if (priv == 0)
+ return 0;
+
for (int pass = 0; pass < NumSuffixes; ++pass) {
TargetHash::const_iterator i = priv->targetHash.constFind(Doc::canonicalTitle(target + suffixes[pass]));
if (i != priv->targetHash.constEnd()) {
if (relative && !relative->qmlModuleIdentifier().isEmpty()) {
for (int i=0; i<bestTargetList.size(); ++i) {
const Node* n = bestTargetList.at(i).node;
- if (relative->qmlModuleIdentifier() == n->qmlModuleIdentifier()) {
+ if (n && relative->qmlModuleIdentifier() == n->qmlModuleIdentifier()) {
atom = bestTargetList.at(i).atom;
return n;
}