#1665 Handle end of file without error when parsing command file

This commit is contained in:
Bjørnar Grip Fjær
2017-07-27 15:43:57 +02:00
parent d0564c4d2a
commit 865238bc71
2 changed files with 9 additions and 2 deletions

View File

@@ -69,6 +69,12 @@ std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands(QTextStream&
}
}
if (commandName.isEmpty() && inputStream.atEnd())
{
// Read past the last command
break;
}
CAF_ASSERT(objectFactory);
caf::PdmObjectHandle* obj = objectFactory->create(commandName);
RicfCommandObject* cObj = dynamic_cast<RicfCommandObject*>(obj);