Don't crash when pro-file is empty.

Reviewed-by: Oswald Buddenhagen
This commit is contained in:
Robert Loehning
2010-02-24 16:23:40 +01:00
parent fd7c117328
commit 6639da4df5

View File

@@ -668,7 +668,7 @@ void Qt4PriFileNode::changeFiles(const FileType fileType,
contents = QString::fromLatin1(qfile.readAll()); // yes, really latin1
qfile.close();
lines = contents.split(QLatin1Char('\n'));
while (lines.last().isEmpty())
while (!lines.isEmpty() && lines.last().isEmpty())
lines.removeLast();
} else {
m_project->proFileParseError(tr("Error while reading PRO file %1: %2")