Commit 6dd42884 authored by Eike Ziller's avatar Eike Ziller
Browse files

Guard against infinite loop in pathOrDirectoryFor(Node*,bool)

QFileInfo::absolutePath prints a warning and returns an empty string, if
given an empty string for the file path.

Task-number: QTCREATORBUG-17927
Change-Id: Ie49fc1500937c00ba579281785435e57464639ae
Reviewed-by: default avatarhjk <>
parent 9774f117
......@@ -2122,7 +2122,7 @@ static QString pathOrDirectoryFor(Node *node, bool dir)
while ((!fi.exists() || !fi.isDir()) && !fi.isRoot())
location = fi.absoluteFilePath();
} else {
} else if (!path.isEmpty()) {
QFileInfo fi = path.toFileInfo();
// remove any /suffixes, which e.g. ResourceNode uses
// Note this should be removed again by making node->path() a true path again
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment